I am using reflection to emit some dynamic types at runtime. Why is not really important.
My problem right now is that using classes like AssemblyBuilder, ModuleBuilder and TypeBuilder, a type is generated perfectly and I can work with it without a problem.
However there can be instances where I might need to change the definition of the generated type. How do I remove a generated type from a generated 开发者_Go百科assembly?
You'd need to generate the types in their own AppDomain and unload the whole thing. Even then, you'd have to be careful not to let an instance cross the domain boundary, else it might load the type into your primary domain.
精彩评论