This project is read-only.

Emit to Dynamic Assembly a Dynamic Type

Topics: PE Writer, Source Model
Mar 26, 2010 at 8:13 PM

I am looking into possibly using CCI to emit a dynamic type to an in memory dynamic assembly.

1. Is this possible?

2. How do I indicate that an assembly is Dynamic?
In System Reflection I would use:

AssemblyName name = new AssemblyName("DynamicClasses");
AssemblyBuilder assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.Run);
ModuleBuilder module = assembly.DefineDynamicModule("Module");

However I couldn't find an equivalent technique in CCI.

 

 

Mar 26, 2010 at 8:15 PM

It might be possible, but I don't think I currently know how to do it. Right now, this scenario is not supported.

Mar 26, 2010 at 9:29 PM

I'll peek under the hood and see how hard this would be to do. If it's relatively easy I'll see if I can do it.

Thanks.