加载针对性的.NET 4.5在.NET 4.0应用程序域的组件 [英] Loading an assembly targetted for .NET 4.5 on a .NET 4.0 app domain

查看:262
本文介绍了加载针对性的.NET 4.5在.NET 4.0应用程序域的组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设系统具有.NET 4.0和.NET 4.5安装。

Assuming the system has .NET 4.0 and .NET 4.5 installed.

是否有可能加载和与.NET 4.5组件从书面打靶.NET 4.0的装配工作?

Is it possible to load and work with a .NET 4.5 assembly from an assembly written targetting .NET 4.0 ?

简单的说,我可以打电话的Assembly.Load从.NET 4.0 code加载.NET 4.5打靶组装?

Simply put, can I call Assembly.Load from .NET 4.0 code to load a .NET 4.5 targetting assembly ?

推荐答案

假设一个系统,.NET 4.0和.NET 4.5:

Assuming a system as .NET 4.0 and .NET 4.5:

作为<一说href="http://marcgravell.blogspot.nl/2012/09/iterator-blocks-missing-methods-and-net.html">marcgravell's博客通过sehe链接

4.5就地过度的顶部安装在4.0之上,在GAC;一旦你已经安装了4.5,4.0次操作,4.5组件

4.5 is an in-place over-the-top install on top of 4.0, in the GAC; once you have installed 4.5, 4.0 runs with the 4.5 assemblies

然后调用的Assembly.Load从.NET code目标4.0(由4.0编译器编译),将在实际使用4.5框架实现运行,因此我看不出有任何理由为什么它无法加载4.5组装。

Then calling Assembly.Load from a .NET code targeting 4.0 (compiled by a 4.0 compiler), will actually run in using the 4.5 framework implementation, so I don't see any reason why it couldn't load a 4.5 assembly.

margravell指出,当您试图在仅安装4.0的系统上运行.NET 4.5编译code会出现问题,因为收益率回报的执行/突破迭代器会导致丢失的方法引用。但是,这不应该影响到你。

margravell notes that problems occur when you try to run .NET 4.5 compiled code on a system with only 4.0 installed, as the implementation of the yield return/break iterators causes a missing method reference. But this shouldn't affect you.

这篇关于加载针对性的.NET 4.5在.NET 4.0应用程序域的组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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