Search code examples
c#.netreflectionclr

how to read the assembly manifest without loading the .dll


Essentially need to read the dependencies programmatically without loading the assembly itself, as then you can't unload them


Solution

  • 2 solutions come to my mind, although I think there's easier way (which I forgot or don't know :) ):
    1. Load your assemblies using some additional AppDomain that you can create. Unloading whole AddDomain will also unload loaded assemblies (but only those, which were loaded using this AppDomain).
    2. Use some api, for example CCI that allows you to look inside managed dll's without loading it using reflection mechanism.