locked
Running Tests in VS2013 Premium and VS2015 Enterprise RRS feed

  • Question

  • User564952083 posted

    I have encountered an odd problem.  When I run all tests in Visual Studio 2015 a lot of them fail with a message like this;

    "Mixed mode assembly is built against version 'v2.0.50727' of the runtime 

    and cannot be loaded in the 4.0 runtime without additional configuration
    information."

    When I run the tests in Visual Studio 2013 I do not get those errors.  In my test project's app.config I already have this set in the configuarion node.

      <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
      </startup>

    Any suggestions on how I can run my tests so I can switch to 2015 completely?

    Tuesday, October 13, 2015 11:29 AM

Answers

  • User-166373564 posted

    Hi,

    "Mixed mode assembly is built against version 'v2.0.50727' of the runtime  and cannot be loaded in the 4.0 runtime without additional configuration
    information."

    To configure an App to Support .NET Framework 4 or 4.5, 2.Add the <supportedRuntime> element as follows to the application configuration file:  

    <configuration>    

      <startup> 

        <supportedRuntime version="<version>"/>

      </startup>

    </configuration>

    .NET Framework 4 and 4.5 (including point releases such as 4.5.1): "v4.0"

    .NET Framework 2.0, 3.0, and 3.5: "v2.0.50727"

    Hope it helps.

    With regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 14, 2015 10:26 PM