none
Using unmanaged DLL (installed in WinSxS) in VSTO Excel addin. RRS feed

  • Question

  • Hello,

    I have developed an Excel VSTO addin, written in C#. From the addin I make calls into unmanaged assembly through pinvoke. My unmanaged assembly is properly installed in Windows Side By Side cache (WinSxS). I can call its methods from other programs if I add the assembly as a dependency to an application manifest.
    Unfortunately I cannot make my addin find my unmanaged assembly. Every call throws a File Not Found exception. The only way that works is adding the unmanaged DLL as a dependency in excel.exe.manifest. I know this method is dirty and I don't want to use it.
    Even if I simply put my unmanaged DLL into my addin's directory, the addin can then find the DLL but not its dependent MFC libraries, so the calls still fail. I have tried adding MFC manifest as a dependency to my addin project but id didn't work.
    My question is: is there any way to make VSTO addin "see" WinSxS unmanaged DLL?

    Thank you,

    Jimmy Joe

    Wednesday, October 28, 2009 7:41 PM

All replies

  • How about declaring the dependency in the configuration file like so:

    <dependentAssembly>

       <codebase comAddin="c:\whatever">

    that should work for you.

    Monday, September 13, 2010 3:34 PM