I'm working on a COM add-in project for Office. Because I don't want the overheard of VSTO, I'm going with the approach of using a C++ shim, as created by the wizard provided by MS for generating these things. My shim has been tweaked to download one of two separate .NET add-ins depending on which version of the Office app. I've got it working on all the machines I build on, but when installing on a VM it fails to load.
I've traced it down to a failure in my unmanaged CLR Loader's call to CreateInstance. The assembly is signed, and the shim, assembly and a handful of dependent assemblies are all installed in the same folder.
The CLR Loader is creating the _AppDomain object and correctly setting the ApplicationBase folder to where it's all living. Into CreateInstance I'm passing in the correct assembly name, complete with the correct PublicKeyToken value, and the correct class name in the assembly (remember, I have this all working on several other machines).
CreateInstance is returning a "FileNotFound" error. The assembly *is* in the right place, and the classname *is* correct. I fired up 'fuslogvw' based on instructions I found elsewhere, and as I read the log, it's actually correctly loading the assembly.
The implication is that there's "something" that CreateInstance doesn't like about the assembly on this particular machine. I can't tell if maybe there's some dependency that's a problem, or what.
Are there any troubleshooting tips on how I can figure out more precisely why CreateInstance fails in this case?