How to load a .NET assembly for reflection operations and subsequently unload it?

后端 未结 5 817
青春惊慌失措
青春惊慌失措 2020-11-28 06:11

I\'m writing a tool to report information about .NET applications deployed across environments and regions within my client\'s systems.

I\'d like to read the values

5条回答
  •  迷失自我
    2020-11-28 06:32

    You have to use application domains, there's no other way to unload an assembly. Basically you have to use code like this:

    
    AppDomain tempDomain = AppDomain.CreateDomain("Temp Domain");
    tempDomain.Load(assembly);
    AppDomain.Unload(tempDomain);
    
    

提交回复
热议问题