2

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.

2
  • 1
    I doubt reloading is possible, especially since MSDN clarifies that .NET framework cannot unload assemblies (for which AppDomain is a substitute). You could always put your assembly in the GAC too, although it's much less convenient. Have your ever found another way? Commented Nov 30, 2019 at 15:46
  • I am also curious to know if you ever solved this or found another way. Maybe forcing the initial load into shared? Commented Jun 18, 2020 at 13:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.