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?