Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the...

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>

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

转载于:https://www.cnblogs.com/lifuyun/p/lifuyun2013110101.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值