Edit AssemblyBuilder ImageRuntimeVersion

Is it possible to dynamically create an assembly designed for a different runtime from the current AppDomain.

For example, from a .NET 4.0 application, I want to create a new assembly designed instead of .NET 2.0.

AssemblyBuilder builder = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave); var version = builder.ImageRuntimeVersion; //"v4.0.30319" 
+6
source share
1 answer

If it is still necessary, I found the following example:

MSDN Blog - Orientation of the .NET 2 Platform Using AssemblyBuilder in .NET 4

It looks like you should use your own CLR API.

+7
source

Source: https://habr.com/ru/post/892556/


All Articles