Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to troubleshoot a VSTO addin that does not load?

My VSTO Outlook Add-in suddenly stopped working on one customer machine (it does not load, no error message) and I'm stuck with troubleshooting. The machine is Windows 7 x86, Outlook 2007. The add-in is written with Visual Studio 2008 and uses VSTO 2005 with the 2003 PIAs (because we need to support Outlook 2003 as well). It works perfectly fine on other machines.

Here's what I tried to get useful troubleshooting output:

  • Add the VSTO_SUPPRESSDISPLAYALERTS environment variable (set to 0).
  • Start Outlook with administrative permissions.
  • Look into the event log.

Nothing. The add-in just won't load without giving any indication of the reason. I've also checked the "usual suspects" (CAS policy, PIAs installed, LoadBehavior in the registry, reinstalling VSTO and the add-in).

Some other observations:

  • LoadBehavior in the registry stays at 3.
  • The add-in shows up as "disabled" in Outlook. Checking its checkbox in "COM add-ins" just does nothing (no error, checkbox is cleared again when entering the form a second time).
  • It works perfectly fine on other customer machines, and it worked perfectly fine on this machine. (No, the customer cannot tell me what changed on his machine.)
  • I have a Trace.WriteLine message at the very top of my code (first line in the ThisAddIn_Startup handler), which is not reached (I checked with DebugView). Thus, the reason for not loading is not an exception in my add-in but rather a failure of VSTO to load the add-in or of Outlook to load VSTO.

Instead of more random debugging ("try this...", "try that..."), I'd really like to force Outlook and/or VSTO to tell me what's wrong, i.e. to give me a useful error message instead of just doing nothing when trying to enable the add-in. Any ideas?

like image 773
Heinzi Avatar asked Jan 12 '11 12:01

Heinzi


People also ask

How do I troubleshoot an Outlook add-in?

If an Outlook add-in running on Windows and using Internet Explorer is not working correctly, try turning on script debugging in Internet Explorer. Go to Tools > Internet Options > Advanced. Under Browsing, uncheck Disable script debugging (Internet Explorer) and Disable script debugging (Other).

How do I update VSTO add-ins?

If you want to get your add-in auto-updated you need to publish it to any web server and then install it from there. Then if required you may publish an update. Your add-in will be automatically updated.


2 Answers

Here's a bit more detail on RobertG5's solution (too long for a comment):

The problem was that the add-in had been hard disabled by Outlook. As I've learned, that's something different than the "usual" not-loading scenario. The key to realizing this was to notice that the add-in did not show up under Inactive Application Add-Ins, but rather under Disabled Application Add-Ins. That makes a difference: In the latter case, just going to the COM-AddIn screen and ticking the check box just does nothing. (I guess a nice message box "You cannot load this add-in because it has been hard-disabled" would be too much to ask... sigh.)

So, how do I re-enable a hard disabled add-in?

  1. In the Manage box, change COM Add-ins to Disabled Add-ins, and then click Go.
  2. Select the add-in and click Enable. Click Close.

OK, now the add-in can be loaded again:

  1. In the Manage box, change Disabled Add-ins to COM Add-ins, and then click Go.
  2. select the check box next to the disabled add-in. Click OK.

Reference: http://msdn.microsoft.com/en-us/library/ms268871.aspx

like image 165
Heinzi Avatar answered Sep 18 '22 04:09

Heinzi


Did you try enabling the add-in again? It won't run after its in the disabled queue. After you re-enable it from the disabled add-in screen, you can then check the box in the COM-AddIn screen to have it load which then should prompt you more detail since you set the VSTO_SUPPRESSDISPLAYALERTS variable about what may have happened in the first place.

like image 38
Gardner Avatar answered Sep 20 '22 04:09

Gardner