您的位置:首页 > 产品设计 > UI/UE

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

2011-01-05 15:11 1011 查看
最近在用VS2010 进行.net 4.0开发时报了如上这条错误

 

项目为 WINFORM,引用的DLL为2.0 而主项目为4.0 于是这个错误:

 

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.

 

将DLL转为 4.0 依旧报这个错误

 

最后在CONFIG 中添加如下代码解决:

 

 

<CONFIGURATION>
<STARTUP useLegacyV2RuntimeActivationPolicy="true">
<SUPPORTEDRUNTIME version="v4.0" />
<REQUIREDRUNTIME version="v4.0.20506" />
</STARTUP>
</CONFIGURATION>
 

 

原文地址:http://social.msdn.microsoft.com/Forums/en/clr/thread/58271e39-beca-49ac-90f9-e116fa3dd3c0

 

注意:VS2010 默认也会根据项目添加 STARTUP这个节点,但是仍然会报错。

 

需要手动添加如下代码,问题才得以解决:

useLegacyV2RuntimeActivationPolicy="true"

<REQUIREDRUNTIME version="v4.0.20506" /> 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  assembly winform dll 2010 .net c
相关文章推荐