降级从.NET 4.0至3.5的应用程序 [英] Downgrade an application from .net 4.0 to 3.5

查看:800
本文介绍了降级从.NET 4.0至3.5的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发在VS2010的应用程序,并编译它在.NET 4.0作为目标框架。集成库到我的应用程序后,我收到以下错误消息,当我试图编译:

I have been developing an application in VS2010 and compiling it for the .NET 4.0 as the target framework. After integrating a library into my application, I get the following error message when I try to compile:

混合模式组件构建针对运行时的版本V1.1.4322',不能在4.0运行时无需附加配置信息加载。

Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

.NET 3.5下的图书馆工作正常,但是当我改变我的目标框架到.NET 3.5,我得到了下面的错误我所有的.resx文件:

The library works fine under .NET 3.5, but when I change my target framework to .NET 3.5, I get the following error for all my .resx files:

1时出错对象引用不设置到对象的实例。

Error 1 Object reference not set to an instance of an object.

我试过CTRL-H版本= 4.0.0.0到版本= 3.5.0.0,但这似乎并没有工作。有什么我可以做其他的,创造一个新的应用程序?

I tried ctrl-h Version=4.0.0.0 to Version=3.5.0.0 but that doesn't seem to work. Is there anything I can do other that create a new application?

推荐答案

您应该能够使这项工作由配置设置中的app.config。

You should be able to make this work by configuration settings in app.Config.

就在 useLegacyV2RuntimeActivati​​onPolicy =真正的标记添加到您的 AppConfig的在启动部分。这使得.NET 4运行时处理旧的混合模式组件。

Just add the useLegacyV2RuntimeActivationPolicy="true" flag to your appConfig in the startup section. This causes the .NET 4 runtime to handle older mixed-mode assemblies.

这篇关于降级从.NET 4.0至3.5的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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