I have reviewed several other posts about how to get the CLR to find an assembly that is not in the same folder or any subfolder of the executable and am unable to get it to work for me. ClassLibrary1.dll is an unsigned assembly. The examples show:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="ClassLibrary1"/>
<codeBase version="1.0.0.0"
href=file:///C:\somepath\subfolder\ClassLibrary1.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I created a console application and put the above with the proper path in its configuration file, but still get a message indicating that it cannot find ClassLibrary1.dll. I used FUSLOGVW and it did not even check in the folder supplied in the CodeBase element. Does anyone know why this does not work?
From MSDN:
If the assembly has a strong name, the codebase setting can be anywhere on the local intranet or the Internet. If the assembly is a private assembly, the codebase setting must be a path relative to the application's directory.
It means that if you do not sign your assembly then it must be located in the application folder or in a sub-folder of the application folder. If you want to put your application in c:\Program Files\MyApplication and your assembly in c:\MyAssemblies you have to sign the assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With