How to read assembly manifest without loading .dll

In fact, you need to read the dependencies programmatically without loading the assembly itself, since you cannot unload them

+4
source share
5 answers

2 solutions come to my mind, although I think it’s easier there (that I forgot or don’t know :)):
1. Download your builds using another AppDomain that you can create. Unloading entire AddDomain also unloads loaded assemblies (but only those that were loaded using this AppDomain ).
2. Use some api, for example CCI , which allows you to view a managed dll without loading using the reflection mechanism.

+2
source

found this System.Reflection.Assembly.ReflectionOnlyLoadFrom (path) does the trick

+5
source

Kumar

You can unload .Net DLLs, but you must use the AppDomain object to load them first and then again to unload them.

Take a look: http://msdn.microsoft.com/en-us/library/system.appdomain(VS.80).aspx

If you still want to avoid this type of process, I assume that you could parse the DLL yourself, but that would be much more than using AppDomain, I think.

-p

+2
source

Hope you expect Ildasm.exe (intermediate language disassembler)

http://msdn.microsoft.com/en-us/library/aa309387(VS.71).aspx

0
source

I'm sure someone will correct me if I am wrong, but is the manifest just another resource in the DLL? If so, you can read it just like any other resource.

Here is an open source tool that allows you to explore DLL resources:

 http://www.wilsonc.demon.co.uk/d10resourceeditor.htm 

And, of course, I see inline manifestations with it.

So, load the DLL using LoadLibrary () and go on the search for resources.

0
source

All Articles