This Assembly Is Built by a Runtime Newer than the Currently Loaded Runtime

PROBLEM

When using ArtOfTest.Runner.exe on the Execution Server, you receive one of these errors about a difference in versions:

 

System.BadImageFormatException: Could not load file or assembly '___' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
System.BadImageFormatException: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. (Exception from HRESULT: 0x8013101B)

SOLUTION 1

It is not permissible to make a copy of ArtOfTest.Runner.exe and execute it from a different location. There is a dependency that requires it to be run from its original location. This is true even if a system environment variable points to that location. By default the location is:

  • C:\Program Files (x86)\Telerik\Test Studio 20XX.X\Bin

 

For more information please see our user's guide article on ArtOfTest.Runner.

SOLUTION 2

Note: As of 2011.2.1007, this solution is no longer necessary. This version added support for loading custom assemblies built against .NET 4.0.

 

This means the project is built against .NET 4.0, but the Execution Server is running by default on .NET 2.0 (which cannot load 4.0 assemblies). To overcome this, change the Service and the Execution Server Run-time Version to .NET 4.0 on the problematic machine.

 

For the Scheduling Service

  1. Open the install folder. By default this is located at C:\Program Files (x86)\Telerik\Test Studio\Bin
  2. Create a config file named Telerik.TestStudio.Scheduling.WindowsService.exe.config containing the code below.
  3. Restart the Service.
  4.  

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
        <supportedRuntime version="v3.5" sku=".NETFramework,Version=v3.5"/>
    </startup>
    </configuration>

 

For the Execution Server

  1. Open the install folder. By default this is located at C:\Program Files (x86)\Telerik\Test Studio\Bin
  2. Find the Telerik.TestStudio.Scheduling.Client.exe.config file.
  3. Open it with a text editor such as Notepad.
  4. Edit it to match the code below.
  5. Restart the Execution Server.
  6.  

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
        <supportedRuntime version="v3.5" sku=".NETFramework,Version=v3.5"/>
      </startup>  
      <appSettings>
        <add key="ConfigServiceUrl" value="http://localhost:8008/TestStudio/ConfigurationService" />
        <add key="x" value="100"/>
        <add key="y" value="100" />
        <add key="WaitForService" value="10000"/>
        <add key="Tracing" value="True" />
      </appSettings>    
    </configuration>