混合模式程序集是针对运行时版本“v2.0.50727”构建的,无法在4.0运行时加载 [英] Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime
问题描述
在命令行执行后运行execuable之后,我遇到了这个异常:
I got this exception after runing an execuable in command line execution:
混合模式程序集是针对运行时版本v2.0.50727构建的并且无法在没有其他配置信息的情况下在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."
在互联网上搜索此问题后,我发现一个出路是配置App.Config文件。
在VS2010工作正常,但仍然在命令模式下产生相同的错误。
After search this issue on internet, I found one of the way out is to configure App.Config file. That works fine in VS2010 but still generates same error in command mode.
所以有什么办法来解决这个问题,使用命令行生成较新版本的.dll是不可能的。
So is there any way to resolve this by using command line as generating newer version of .dll is impossible.
感谢!
推荐答案
.config和ProgramName.exe.config文件。
Make sure you have configured both the App.config and the ProgramName.exe.config file.
例如:
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
这篇关于混合模式程序集是针对运行时版本“v2.0.50727”构建的,无法在4.0运行时加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!