asp.net dnxcore50 load assembly by file path

454 views Asked by At

How do you load an assembly in asp.net under dnxcore50 (DNX Core 5.0)?

I have a Lib/FooLibrary.dll path in the directory where my asp.net 5 app lives, but i cannot seem to find any way of loading the assembly via reflection

My ultimate goal is to use reflection to load the assembly and get some MethodInfos in order to do some light-weight code generation.

1

There are 1 answers

2
Marko M. On BEST ANSWER

You are after IAssemblyLoadContextAccessor and IAssemblyLoaderContainer.

Example of usage can be found at asp.net home repo at github here.