2

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(...);

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.

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

Peervm
  • 482
  • 4
  • 11

1 Answers1

5

Have a look at this question: http://social.msdn.microsoft.com/Forums/en/clr/thread/1bfd7f40-fd57-4c9f-803f-aa4b19214af9.

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:

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

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443