How to add folder to assembly search path at runtime in .NET?
- by Valery Tydykov
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.