I am pretty new to working with class libraries and was hoping someone could tell me if I'm missing something or if what I'm trying to do is even worth it:
I have a dll that is being run from a VB6 application. We'll call it test.dll. Test.dll uses another .dll, that we'll call Dep.dll.
At first, I just added the reference to Dep.dll in Test.dll and set Copy Local = 'False'. Then I set the assembly binding in the VB6 application config file:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Dep Name"
publicKeyToken="xxxxxxxxxxx"
culture="neutral" />
<codeBase version="1.0.0.2"
href="file:\\dir_name\dep.dll"/>
<bindingRedirect oldVersion="1.0.0.0" newVersion="1.0.0.2"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
But I hear that I could have created a app.config file for Test.dll and had the aforementioned entry in there instead of in the app config file for the VB6.exe.
For some reason, I couldn't get the reference to work this way. Here is the error message:
Could not load file or assembly 'Dep.dll, Version=1.0.0.2,Culture=neutral,PublicKeyToken=xxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.
I changed the Build Action property to the app.config file to 'Content' and Copy Output property to 'Copy Always'. I also didn't do anything to the original reference to Dep.dll in Test.dll's project file. I removed the assembly binding entry for Dep.dll from the VB6.exe's app.config file.
We have a single working example here of a dll using an app.config file, however it doesn't bind assemblies, just has a bunch of app settings.
The research I'm doing is suggesting that maybe what I'm doing isn't possible or even best practice, but now I'd just like to know whether what I'm trying is possible. If so, what am i missing?