title: How to troubleshoot a VSTO addin that does not load?
body: <p>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.</p>
  
  <p>Here's what I tried to get useful troubleshooting output:</p>
  
  <ul>
  <li><a href="http://www.scinaptic.com/support/0053.html" rel="noreferrer">Add the <code>VSTO_SUPPRESSDISPLAYALERTS</code> environment variable (set to <code>0</code>)</a>.</li>
  <li>Start Outlook with administrative permissions.</li>
  <li>Look into the event log.</li>
  </ul>
  
  <p>Nothing. The add-in just won't load without giving <em>any</em> 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). </p>
  
  <p>Some other observations:</p>
  
  <ul>
  <li><code>LoadBehavior</code> in the registry stays at <code>3</code>.</li>
  <li>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).</li>
  <li>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.)</li>
  <li>I have a <code>Trace.WriteLine</code> message at the very top of my code (first line in the <code>ThisAddIn_Startup</code> handler), which is not reached (I checked with <a href="http://technet.microsoft.com/en-us/sysinternals/bb896647" rel="noreferrer">DebugView</a>). 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.</li>
  </ul>
  
  <p>Instead of more random debugging ("try this...", "try that..."), I'd really like to <strong>force Outlook and/or VSTO to tell me what's wrong</strong>, i.e. to give me a useful error message instead of just <em>doing nothing</em> when trying to enable the add-in. Any ideas? </p>