Visual Studio中添加DLL作为引用错误 [英] Visual Studio adding DLL as reference error

查看:286
本文介绍了Visual Studio中添加DLL作为引用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加库到项目,我也得到了以下错误:




混合模式组件内置反对
版本运行
的'V2.0.50727'和不能在4.0
运行时无需附加
配置信息被加载




我也不太清楚什么我为了这个来回跑来调整。任何人都知道的变化应该是什么?



谢谢,



PM


< DIV CLASS =h2_lin>解决方案

正如马克说,理想情况下你会重建.NET 4的的使您的项目目标.NET 3.5或更低。为v2的CLR使用传统的运行时激活技术不与v4的CLR的对在同一进程中运行多个的CLR能力很好地工作内置混合模式集。



另外,你可以将此信息添加到您的app.config:

 <结构> 
<启动useLegacyV2RuntimeActivationPolicy =真正的>
< supportedRuntime版本=V4.0/>
< /启动>
< /结构>

请参阅的这个问题,的这个文档这的博客帖子了解详情。


I'm adding a library to a project, and I get the following error:

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.

I'm not too sure about what I have to tweak in order fro this to run. Anyone know what the changes should be?

Thanks,

PM

解决方案

As Marc says, ideally you'd rebuild in .NET 4, or make your project target .NET 3.5 or lower. Mixed-mode assemblies built for the v2 CLR use "legacy" runtime activation techniques which don't work well with the v4 CLR's ability to run multiple CLRs in the same process.

Alternatively, you can add this information to your app.config:

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
</configuration>

See this question, this documentation and this blog post for details.

这篇关于Visual Studio中添加DLL作为引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆