Loading unmanaged Dlls during ThisAddin_Startup in VSTO RRS feed

  • Question

  • We have a VSTO/C#/.NET 4.0 Add-In we're writing for Outlook 2010.  The problem we're having is that we need to have a DLL loaded by the time Outlook is up.

    We need to load a dll at some point during startup or immediately after startup.

    I do a [DllImport("Kernel32.dll")] to get "LoadLibrary".  When the call is made to LoadLibrary inside of "ThisAddin_Startup" I get a "LoaderLock" message. 

    During debug sessions we can continue past this message, however in the release version this simply causes a hang for obvious reasons.

    Any ideas as to how to load a dll during or immediately after an Add-In as loaded?

    Tuesday, October 16, 2012 12:09 PM