If you ship your assembly via Assembly.Load , dependencies are searched in the same place as for the main application, that is, in the application directory and its subdirectories of the en-US , ru-RU (for language resources). Investigation in the comments showed that your files are in the Data subdirectory, so localized resources are not located.
The simplest solution is to transfer the library to the directory with the main program, and its localization - and the subdirectories en-US , ru-RU , etc. of the program directory.
Another way is to change the configuration of the program, allowing it to find dependencies in other directories. MSDN says you need to add a section to app.config :
<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <!-- здесь должен быть указан ваш каталог Data --> <probing privatePath="bin;bin2\subbin;bin3"/> </assemblyBinding> </runtime> </configuration>
A more strict path, with an indication of publicKeyToken , is described here (such a path will prevent loading anything , and only allow loading the necessary assembly):
<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Reports" culture="neutral" publicKeyToken="<здесь укажите токен>"/> <codeBase version="тут версия" href="FILE://тут путь"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
You will have to sign an assembly (as well as dependent localized assemblies!) With sn -k .
Another way described there is to subscribe to the AssemblyResolve event, and load the assembly via LoadFrom in it.
However, according to this article , LoadFrom can help LoadFrom instead of Load . But this is not a completely clean solution if the loadable library has dependencies on the libraries of the main application.
Assembly.Loadwith something else, now I’ll look for sure. - VladD.\ru-RU\Reports.resources.dll, etc. - VladD