Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

.net Core 2.0 Reflection only load of an assembly

$
0
0

Hello,

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


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>