mardi 13 février 2018

Inspecting an assembly only in .net core 2.0 (no execute)

Is there a way in .net core 2.0 to load an assembly and get its custom attributes without loading all the dependencies? I have tried the following:

  • Assembly.ReflectionOnlyLoad - throws an exception - "loading is not supported on this platform"
  • Assembly.LoadFrom/Assembly.LoadFile/Assembly.Load - they all try to load the assembly's dependencies - which are not available in my context. I don't want to load the assembly and execute it, I just want to get the names of the custom attributes from the assembly.
  • Mono.Cecil used to do this in .Net framework 4.x, but its not available for .net core 2.0

Are there any other options available?

Thank you,

VK





Aucun commentaire:

Enregistrer un commentaire