.net 运行时的“v2.0.50727”,如果没有附加配置信息,则无法在 4.0 运行时中加载
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3491279/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information
提问by kapil
I am converting the .vcproj from VS2005 to VS2010 but after converting it is giving the below mentioned error.
我正在将 .vcproj 从 VS2005 转换为 VS2010,但在转换后出现以下错误。
Additional information: 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.Additional information: 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.
附加信息:混合模式程序集是针对运行时的“v2.0.50727”版本构建的,如果没有附加配置信息,则无法在 4.0 运行时中加载。附加信息:混合模式程序集是针对运行时的“v2.0.50727”版本构建的,并且不能在没有附加配置信息的情况下在 4.0 运行时加载。
and then i have added the app.config file in my project and added the below mentioned information in my file but it is still giving the same error.
然后我在我的项目中添加了 app.config 文件并在我的文件中添加了下面提到的信息,但它仍然给出相同的错误。
can any one help me in resolving the above mentioned problem.
任何人都可以帮助我解决上述问题。
回答by Matt B
回答by Rich Elswick
I added the following:
我添加了以下内容:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
<requiredRuntime version="v4.0.20506"/>
</startup>
to my app.config for a VS2008 Express Edition to VS2010 Express Edition imported project. Worked fine for me.
到我的 app.config 用于 VS2008 Express Edition 到 VS2010 Express Edition 导入的项目。对我来说效果很好。
回答by abatishchev
Open each project's properties - and set version to either 2.0/3.0/3.5 or 4.0
打开每个项目的属性 - 并将版本设置为 2.0/3.0/3.5 或 4.0
回答by Alexander Tytarchuk
Try to use another config file (not the one from your project) and RESTART Visual Studio:
尝试使用另一个配置文件(不是您项目中的配置文件)并重新启动 Visual Studio:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.x86.exe.config (32-bit)
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.x86.exe.config(32 位)
or
或者
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.exe.config (64-bit)
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.exe.config(64 位)

