How to download nuget package and load its assembly in runtime?
I'm developing a CMF system, using asp.net 5. I think what i should implement plugin system using nuget packages, because of dnx principle "NuGet all the things".
- How i can search, download, unpack package in runtime?
- And how i can load dll from package in runtime?
(Similar question on stackoverflow: http://stackoverflow.com/questions/30989788/load-nuget-package-and-its-assembly-in-runtime)
How i can search, download, unpack package in runtime?
Using NuGet APIs, this has nothing to do with the runtime per se. Run dnu restore.
And how i can load dll from package in runtime?
Here's an example on how to add a custom assembly loader https://github.com/aspnet/Entropy/blob/dev/samples/Runtime.CustomLoader/Program.cs
Thank you for answer.
Hello,
Nowadays, is there any API to load a NuGet Package Reference (already in ./dnx/packages), or just with custom assembly loader like answered above? Maybe something new in Microsoft.Dnx.Runtime.Nuget or Microsoft.Dnx.Runtime.Loader?
And, how about automatically load dependencies (these are another Packages) of a NuGet Package?Using custom assembly loader to load direct from dll file will not load dependencies. (In these scenario, analyzing at debug, e.g. _graph field of LibraryManager does not contains my dynamic loaded assemblies. Should have it? Maybe something I made wrong...)
Thanks