开发者

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

As a .NET developer, the line

'<process name>' (Managed): Loaded 'Anonymously Hosted DynamicMethods Assembly'

probably is familiar to you. My question is simple and straightforward: what exactly is this 'Anonymously Hosted DynamicMethods Assembly' and can I make it (pre)load manually? If so开发者_C百科, how? Can this be done via Assembly.Load(...)?


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.


I guess that this is an assembly emitted at run time. Since it's not required to save the assembly to disk, it may not be possible to load it manually (in this case when the code finishes emitting the assembly - into memory - it will use the types defined in the assembly directly - no need to load anything)

For more information see the documentation in msdn.

Best


This is an old question but I just encountered it recently. My code works fine, the thing I can remember I did beforehand is upgraded to the latest telerik update. Then I upgraded my current solution, when i run my application the error appears... The error popups around Html helper "Html.TextboxFor", "Html.PasswordFor" is fine,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜