I wrote a .NET library and this library is called by a VBA macro in a third party application. I used Unmanaged Exports from Robert Giesecke and this part works fine (the library C# code is called, I can step debug inside if I attach to the process, etc).
The problem arises when I need to use types defined in other libraries, for example a WPF GUI that uses Prism Mvvm would need the Microsoft.Practices.Prism.Mvvm assembly. In that case, .NET searches for the assembly but can't find it. Troubleshooting with process monitor, fusion log viewer, I found that the search for the missing assembly is quite short, the only place where the assembly is searched is the application root (e.g. in C:\Program Files\AppName\ ). There is no effort to look in the directory where the dll is, and where the dependencies are. I could copy all the dependencies to the application's root, but that's not a good situation (I don't want to mess into another application's private space)
How do I tell the .NET framework to look at the directory where the DLL is for missing assemblies ?