创建.NET 2.0的AppDomain在.NET 4.0中的过程 [英] Create .NET 2.0 AppDomain in .NET 4.0 process

查看:198
本文介绍了创建.NET 2.0的AppDomain在.NET 4.0中的过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要动态地从我的.NET 4.0的过程创建.NET 2.0兼容的组件。目前,它实现了这一点:

I need to dynamically create a .NET 2.0 compatible assembly from within my .NET 4.0 process. Currently it is achieved with this:

AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly(...)
ModuleBuilder  mb = assemblyBuilder.DefineDynamicModule(...);

但unfortuntely的生产的所有DLL是.NET 4.0(从我的4.0进程继承)不与我的其他.NET 2.0流程工作。

But unfortuntely all dll's produced are .NET 4.0 (inherited from my 4.0 process) which doesn't work with my other .NET 2.0 processes.

不知道如何2个不同的CLR版本的应用程序域可以共存于同一进程?

Any idea how 2 different CLR versioned AppDomains can co-exist in the same process?

推荐答案

有一个在这个问题:<一href="http://social.msdn.microsoft.com/Forums/en/clr/thread/1bfd7f40-fd57-4c9f-803f-aa4b19214af9">http://social.msdn.microsoft.com/Forums/en/clr/thread/1bfd7f40-fd57-4c9f-803f-aa4b19214af9.

保周解释说,这是可能的主机在同一个Windows进程多的CLR,并提供了更详细的信息,下面的链接:

Paul Zhou explains, that it is possible to host multiple CLRs in the same Windows process and provides the following links with more detailed information:

  • CLR Hosting APIs
  • Creating a host application for the .NET Common Language Runtime
  • Host CLR

不过,链接看起来像这样不正是一件容易的事情......

However, the links look like this is not exactly a trivial task...

这篇关于创建.NET 2.0的AppDomain在.NET 4.0中的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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