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 info_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > 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 info

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 info

 2013/11/1 11:12:59  云中深海  博客园  我要评论(0)
  • 摘要:Mixedmodeassemblyisbuiltagainstversion'v2.0.50727'oftheruntimeandcannotbeloadedinthe4.0runtimewithoutadditionalconfigurationinformation.在VS2012上运行一些.net是2.0版本的dll时,会弹出如此错误。大致意思是:混合模式引用是建立针对版本“v2.0.50727”的运行时,不能加载在4.0运行时没有额外的配置信息。网上查到http
  • 标签:can not SEM

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.

在VS2012上运行一些.net是2.0版本的dll时,会弹出如此错误。大致意思是:混合模式引用是建立针对版本“v2.0.50727”的运行时,不能加载在4.0运行时没有额外的配置信息。

网上查到http://social.msdn.microsoft.com/Forums/vstudio/en-US/58271e39-beca-49ac-90f9-e116fa3dd3c0/mxed-mode-dll-unable-to-load-in-net-40?forum=clr

解决方案如下:

The only way the app config updates worked for me was to add it both to the dll assembly and the project using the dll. Also, I had to use the following config update. This is done on a VS2008 or VS2010 project ported to VS2012.
也就说在配置文件里加上如下信息即可:
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
    <requiredRuntime version="v4.0.20506"/>
  </startup>
</configuration>

至此问题解决,大功告成!!!

发表评论
用户名: 匿名