运行.NET 3.5内置混合模式组件在.NET 4中使用的应用程序的配置要求框架3.5,以及 [英] Running .NET 3.5 built Mixed mode assemblies in .NET 4 using app config requires Framework 3.5 as well

查看:254
本文介绍了运行.NET 3.5内置混合模式组件在.NET 4中使用的应用程序的配置要求框架3.5,以及的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是已经创建的线程在这里类似: <一href="http://stackoverflow.com/questions/3179028/mixed-mode-assembly-in-net-4">http://stackoverflow.com/questions/3179028/mixed-mode-assembly-in-net-4

This is similar to already created thread here: http://stackoverflow.com/questions/3179028/mixed-mode-assembly-in-net-4

使用的应用程序的配置,我能够迫使组件对.NET 4中运行。 在XP的机器,我刚刚安装了.NET 4(不包括.NET 3.5和2.0),并试图运行内置的应用程序。它无法加载内置3.5框架的混合模式组件在.NET 4中,而不在机器上的.NET 3.5框架。

Using the app config, I was able to force the assemblies to run on .NET 4. On an XP Machine, I installed just the .NET 4 (without .NET 3.5 or 2.0) and tried to run the built application. It fails to load the mixed mode assembly built in 3.5 framework in .NET 4 without the .NET 3.5 framework on the machine.

为什么要依赖于.NET 3.5的时候,我强迫应用程序使用应用程序配置在.NET 4运行?

Why should it depend on .NET 3.5 when I am forcing the application to run on .NET 4 using App config?

推荐答案

究其原因,是怎样的方式将其绑定到混合模式组件。请确保您使用的useLegacyV2RuntimeActivati​​onPolicy =真的选项在你的启动配置app.config文件(我假设类似于以下):

The reason is, that the way how it binds to mixed mode assemblies. Make sure you use the useLegacyV2RuntimeActivationPolicy="true" option in the startup-configuration of you app.config file (which I assume looks similar to the following):

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0.30319" />
  <supportedRuntime version="v2.0.50727" />
</startup>

另请参见:<一href="http://stackoverflow.com/questions/1604663/what-does-uselegacyv2runtimeactivationpolicy-do-in-the-net-4-config">What是'useLegacyV2RuntimeActivati​​onPolicy在.NET做4配置?

这篇关于运行.NET 3.5内置混合模式组件在.NET 4中使用的应用程序的配置要求框架3.5,以及的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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