Replacing the location from which the runtime looks assemblies on the fly
We have an application that has some "Utils" under it (a few simple programs).
These utils are relying on a few shared DLLs that our application is also using, and so, we would like to distribute these DLLs only once (placed under APP_BASE\bin).
We're looking for a solution, where the utils (placed under APP_BASE\Utils) will be able to lookup in the bin folder (which is NOT RELATIVE under its base dir).
I know that the .NET standard config file allows doing so, only for assemblies that are under relative paths.
Is there any other option for doing so? Our DLLs are not signed and are not placed under th开发者_如何学Ce GAC.
You can use AssemblyResolve event.
We are using this event for loading x86\x64 dlls depending of User's platform.
FIY as a workaround you can also use .net developmentMode
Specifies whether the runtime searches for assemblies in directories specified by the DEVPATH environment variable.
精彩评论