I have seen a number of mails and pages with this subject but as of yet I have not been able to find a working solution. The problem is as folows:

I have developed an Outlook Plug-in using VSTO (have tried building code with both a Outlook 2003 and 2007 project) and all compiles fine and runs from the debugger no problems.

I have added a custom install code, and this seems to add the Policy although this maybe not fully complete Anyhow, strange this is. If I add a new setup project to my solution called secure setup or setup1 (any name really) and set it up to install the DLL's produced by my project. Then I build the Outlook Plugin automatic created setup project and the setup1 project.

Then I run the auto generated setup and it installs the plug-in into Outlook but it fails with the title error. If I then run the second setup program. I rerun outlook and the Plugin is there and is running without the error

If I just run the setup1 exe it doesn't install the Plugin. If I take the registry values from the auto generated setup and put into my setup1 it installs the plugin into outlook but fails with the title error

So, I'm a little confused. I have strongly named my plugin DLL's and even put them into the GAC. I have a custom setup that sets up the runtime security policy for the directory the dll's are installed in (not sure if need to have the dll's in there too).

Any other suggestions for what maybe causing my failure Just find it strange that if I install the two setup projects it runs fine but not if just run one.

Any links to installer code or other appreciated

Re: Visual Studio Tools for Office Not loaded. A runtime error occurred during the loading of the Com Add-in


Hello Netro,

the VSTO loader tries to load your AddIn - so I asume that your Setup is fine.

I belive you are missing something - like an external dll or you try to access a commandbar wich isn't there.

Maybe some logging code would be helpfull here too.

Try to put Trace statements in every method and see where and why your AddIn crashes.

Here is a sample (Trace and Log) about logging mechanism.

(I'm usually have just 1 Setup)

Hope this helps,

Greets, Helmut