Reloading Assembly from Itself into Shared App Domain

181 views Asked by At

I have a strange requirement as I am working on instrumentation of .NET code using C++ code.

In a particular scenario, I need to reload my C# assembly(a dll) into a shared appdomain from that dll itself. Is it possible and how can i achieve that?

The reason for me to do that is(briefly saying), my profiler injects code into .NET Framework modules that are present in GAC(in shared appdomain - EE Shared Assembly repository). The injected code during execution tries to load my .NET dll that is not present in GAC(located in web application's bin) - it loads in AppDomain "/LM/W3SVC/1519733499....".

I need my .NET dll to get loaded in a shared app domain, so that GAC modules will load my dll at runtime. But I need do this(if possible) from that dll itself ( when it get loaded by modules of it's own AppDomain).

Hope my description helps to understand my issue, this is more related to .NET instrumentation and core CLR.

0

There are 0 answers