19Mar/100
Loading Assebmlies with references
Recently I encountered this thing again and had to look for an answer for quite some time (again
).
Just an example of the assembly structure I wanted to have:
- Main.exe
- lib (folder)
- Shared.dll (used by Main.exe, Plugin1.dll and Plugin2.dll)
- Plugin1.dll
- Plugin2.dll
- lib (folder)
The answer – open up your app.config from Main.exe project and add the following (under <configuration> tag):
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib"/>
</assemblyBinding>
</runtime>
That is it. Now it will also search for referenced libraries in the lib folder