What exactly is the 'Anonymously Hosted DynamicMethods Assembly' and how can I make it load manually?

System.Reflection.Emit contains classes that allows you to create dynamically generated code by emitting IL instructions. The DynamicMethod and AssemblyBuilder classes are the work-horses for doing so. IL normally is loaded from an assembly, but there is no assembly when you generate the IL dynamically. An assembly object is however needed to act as the container of the IL code and a "fake" one is created by AppDomain.DefineDynamicAssembly(). That's what you see in the debugger notification.

You can't use Assembly.Load(), the assembly is created dynamically.


This is for DynamicMethods and thus goes for expressions too.

You cannot load it manually.

Tags:

C#

.Net