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 of assembly attributes in these assemblies.
This can be achieved using Assembly.ReflectionOnlyLoad
, however even this approach keeps the assembly loaded. The issue here is that I cannot load two assemblies that have the same name from different paths, so naturally I can't compare the same application deployed in different systems.
At this point I'm assuming the solution will involve using temporary AppDomain
s.
Can someone detail how to load an assembly into another AppDomain
, read the attributes from it and then unload the AppDomain
?
This needs to work for assemblies on the file system as well as those at URL addresses.