Mixed mode assembly is built against version ‘v2.0.50727′ of the runtime

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"/>
</startup>
<runtime>
  <NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>

Any experts can help????

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


尝试在配置节点下的app.config中使用这个确切的启动标记

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

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


I actually had this identical issue with the inverse solution. I had upgraded a .NET project to .NET 4.0 and then reverted back to .NET 3.5. The app.config in my project continued to have the following which was causing the above error in question:

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

The solution to solve the error for this was to revert it back to the proper 2.0 reference as follows:

<startup>
  <supportedRuntime version="v2.0.50727"/>
</startup>

So if a downgrade is producing the above error, you might need to back up the .NET Framework supported version.

链接地址: http://www.djcxy.com/p/29046.html

上一篇: 将节点插入链表的末尾

下一篇: 混合模式程序集是针对运行时版本“v2.0.50727”构建的