针对版本'2.0.50727'构建混合模式程序集 [英] mixed mode assembly is built against version '2.0.50727'

查看:60
本文介绍了针对版本'2.0.50727'构建混合模式程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我遇到了一些问题。我有一个Windows应用程序写在vs 2005然后我转换成VS2010。由于装配问题,我无法运行该应用程序。当我运行它说,混合模式程序集是针对hte运行时版本'v2.0.50727'构建的,无法在没有其他配置信息的情况下在4.0运行时加载。



我用谷歌搜索它找到了一些线索但没有帮助。我甚至不知道该怎么做。

谢谢大家。

解决方案

您的C#项目似乎引用了C ++ / CLI尚未更新到.NET 4.0的项目。





~~~~~~~



在VS 2010中打开您的C ++ / CLI项目并再次构建它。然后确保你的C#项目引用新的DLL而不是旧的。





~~~~ ~~~~~



这是对SA评论的回应:



你只能添加一个引用相同的运行时版本。 .NET 2.0,3.0和3.5都在2.0运行时,因此它们可以相互使用。 .NET 4.0使用全新的4.0运行时,因此您无法将引用与旧版本混合。


该异常清楚地标识了.NET 4.0中包含的某些.NET 2.0.50727组件。在App.config文件中使用:



< startup useLegacyV2RuntimeActivationPolicy =true/> 


Hi all,
I am having some problems. I have a windows application is written in vs 2005 then I converted into VS2010. I can't run the application because of assembly problem. when I run it says,"Mixed mode assembly is built against version'v2.0.50727' of hte runtime and cannot be loaded in teh 4.0 runtime without additional configuration information."

I googled it found some clue but did not help. I don't even have idea what to do.
thanks all.

解决方案

It seems that your C# project references a C++/CLI project that has not yet been updated to .NET 4.0.

[Edit]
~~~~~~~

Open your C++/CLI project in VS 2010 and build it again. And then make sure your C# project is referencing the new DLL and not the old one.

[Edit 2]
~~~~~~~~~

This is in response to SA's comment:

You can only add a reference to the same runtime version. .NET 2.0, 3.0 and 3.5 are all under the 2.0 runtime, so they can be used with each other. .NET 4.0 uses an entirely new 4.0 runtime and so you cannot mix references with older versions.


The exception clearly identifies some .NET 2.0.50727 component was included in .NET 4.0. In App.config file use this:

<startup useLegacyV2RuntimeActivationPolicy="true" /> 


这篇关于针对版本'2.0.50727'构建混合模式程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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