.net 'v2.0.50727' powershell - Mixed mode assembly is built against version ‘v2.0.50727′ of the runtime

3 Answers

The exception clearly identifies some .NET 2.0.50727 component was included in .NET 4.0. In App.config file use this:

<startup useLegacyV2RuntimeActivationPolicy="true" /> 

It solved my problem

'v1.1.4322' c# system.io.fileloadexception

I'm getting the following exception:

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.

as I was trying to export crystal report from my WPF program...

I have added the following in the app.config already...

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

Any experts can help????

Reference I found: http://www.davidmoore.info/2010/12/17/running-net-2-runtime-applications-under-the-net-4-runtime

Please add attribute useLegacyV2RuntimeActivationPolicy="true" in your applications app.config file.

Old Value

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>

New Value

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

It will solve your problem.

For me this was thrown when running unit tests under MSTest (VS2015). Had to add

<startup useLegacyV2RuntimeActivationPolicy="true">


C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\TE.ProcessHost.Managed.exe.config

Mixed-Mode Assembly MSTest Failing in VS2015