My DLLs are loaded by a third-party application, which we can not customize. My assemblies have to be located in their own folder. I can not put them into GAC (my application has a requirement to be deployed using XCOPY).
When the root DLL tries to load resource or type from another DLL (in the same folder), the loading fails (FileNotFound).
Is it possible to add the folder where my DLLs are located to the assembly search path programmatically (from the root DLL)? I am not allowed to change the configuration files of the application.
.net – How to add folder to assembly search path at runtime in .NET
assembliesnetpathsearch
Related Topic
- .net – How to loop through currently loaded assemblies
- C# – load a .NET assembly at runtime and instantiate a type knowing only the name
- Python – How to get the filename without the extension from a path in Python
- C# – How to get the application’s path in a .NET console application
- C# – How to get the assembly file version
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- How to do case insensitive search in Vim
Best Answer
Sounds like you could use the AppDomain.AssemblyResolve event and manually load the dependencies from your DLL directory.
Edit (from the comment):