How to troubleshoot a VSTO that does not load?

My Outlook VSTO add-in unexpectedly stopped working on the same client machine (it doesn’t load, the error message doesn’t appear), and I am stuck in troubleshooting. The machine is Windows 7 x86, Outlook 2007. The add-in was written using Visual Studio 2008 and uses VSTO 2005 since PIA 2003 (since we also need to support Outlook 2003). It works great on other machines.

Here I tried to get a useful troubleshooting solution:

Nothing. The add-in simply does not load without indicating a reason. I also checked the "usual suspects" (CAS policy, installed PIA, LoadBehavior in the registry, reinstalling VSTO and add-ons).

Some other observations:

  • LoadBehavior in the registry remains 3 .
  • The add-in appears as “disabled” in Outlook. Checking its flag in "COM add-ins" simply does nothing (there is no error, the flag is cleared again when you enter the form a second time).
  • It works great on other client machines, and it works great on that machine. (No, the client cannot tell me what has changed on his machine.)
  • I have a Trace.WriteLine message at the very top of my code (the first line in the ThisAddIn_Startup handler) that has not been reached (I checked with DebugView ). So the reason for not loading is not an exception in my add-in, but rather the inability of VSTO to load the add-in or Outlook to download VSTO.

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

+55
vsto outlook-addin
Jan 12 '11 at 12:27
source share
7 answers

Have you tried enabling the add-in again? It will not start after it is included in the turn-off queue. After you turn it back on from the screen with the add-ins disabled, you can check the COM-AddIn screen so that it loads, and then it should show you more detailed information, since you set the VSTO_SUPPRESSDISPLAYALERTS variable about what could happen in first of all.

+41
Jan 13 '11 at 17:59
source share

Here's a little more details about RobertG5's solution (too long for a comment):

The problem was that the add-in was hard disabled for Outlook. As I found out, this is something other than a “normal” script without loading. The key to understanding this was to notice that the add-in did not appear in the "Inactive Application Add-ins" section, but rather in the "Disabled Applications" section. It matters: in the latter case, just go to the COM-AddIn screen and check this box without doing anything. (I think a good field with the message “You cannot load this add-in because it was hard disabled” would be too much to ask ... sigh.)

So how can I enable a hard disconnected add-in again?

  • In the Manage field, change COM add-ins to Disabled add-ins , and then click Go.
  • Select an add-on and click Enable . Click Close .

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

  • In the Manage field, change Disabled Add - Ins to COM Add-Ins , and then click Go.
  • Check the box next to the disabled add-in. Click OK .

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

+46
Jan 14 2018-11-11T00:
source share

I know this is old, but for various reasons, I recently fixed Office add-ins that are not loading.

Heaps of time chewed it, so I thought I would share it, so if your add-in does not load or is not visible, etc., try these solutions.

one). Add-in is not loaded.

Not uploaded. Download failed while loading the COM add-in.

enter image description here

The problem is due to the lack of .Net framework 3.5 or 4.0.

Note: on x64 I only need .Net 4.0, but on x86, I got an error after installing .Net 4.0. After this article, I installed .Net 3.5 and then worked on the x86 PC!

2). Add-in is not loaded.

Double check the spelling of the registry keys. Sometimes I print Behavior, but in American spelling - Behavior, so double-check "LoadBehavior"

enter image description here

Also make sure that "LoadBehavior" is 3, for a list of values ​​see http://msdn.microsoft.com/en-us/library/vstudio/bb386106.aspx#LoadBehavior

3). The add-in is not displayed.

You can make the add-in visible by going to Excel> File> Options> Add-ons> select the "Manage" drop-down list and install it in COM add-ins> Click "GO". In the COM Add-Ins dialog box, verify that the add-in is checked.

four). The add-in has been disabled.

Alternatively, the add-in may be hidden because it has been disabled. You can enable the add-in by going to Excel> File> Options> Add-ons> select the "Manage" drop-down list and set it to "Disabled" and click "GO". Select the add-in that has been disabled and click Enable.

enter image description here

5). ExcelDNA user-defined formula does not display correctly

Instead of seeing the value of the cell you see: #NAME?

Set the following registry key:

  HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\options\OPEN: 

With the correct value:

  /R "C:\Program Files\XYZ\XYZ Addin\ExcelDNA.XYZAddIn.xll" 

6). Excel HANGS after displaying a message

Return the application settings:

  xlApp.ScreenUpdating = true; xlApp.DisplayAlerts = true; xlApp.Calculation = XlCalculation.xlCalculationAutomatic; xlApp.UserControl = true; xlApp.EnableEvents = true; 

7). Further troubleshooting

Include the VSTO log file by adding the following system environment variables:

 NAME: VSTO_LOGALERTS VALUE: 1 

There may be an exception error, so your add-in does not load.

You can check this source for more information on logging and VSTO alerts, but essentially you change two values ​​of the environment variables depending on what you need to do:

Display VSTO alert hints

To display each error in the message box, set the VSTO_SUPPRESSDISPLAYALERTS variable to 0 (zero). You can suppress messages by setting the variable to 1 (one).

Logging VSTO alerts in a log file

To write errors to the log file, set the VSTO_LOGALERTS variable to 1 (one).

Visual Studio Tools for Office creates a log file in the folder that contains the application manifest. The default name is.manifest.log. To stop registration errors, set the variable to 0 (zero).

+34
Feb 05 '13 at 0:34
source share

I would suggest using the Microsoft tool to diagnose add-in problems called AddinSpy .

+6
May 23 '13 at 11:40
source share

Funny for me, I tried rebooting. This is fixed for me. However, the reason he fixed it for me is because I had a hidden Excel.exe file. The application did not start due to this other excel application (I migrated the MSAccess application to VSTO), so Access closed the automation application.

In short, if your admin does not start, quickly check to make sure there are no other Excel applications. This, of course, applies only when you are trying to install a new / launched new one.

(I used this link) https://www.add-in-express.com/creating-addins-blog/2012/11/13/wix-installation-vsto-office-addin/

+1
Oct 11 '16 at 20:31
source share

There is also another way to understand why you are not getting feedback, even if the above environment variables are set. I found that if you received this error after installation (and not the previous VSTO that worked), you should also double-check the registry and the Manifest entry, if you have one.

While Jeremy Thompson points to the registry in his second paragraph, he does not show the manifest entry, which may be part of your registry settings. If your manifest entry does not indicate the correct path and file, it will be displayed in the list of labels with the inscription "Not loaded."

Here we see a bad entry that just points to the VSTO file only, there is no path. enter image description here

This will make your AddIn look like it was loaded with errors, but the errors do not appear and do not appear for you and are not upset. So it will look like below, please note that the location record below also does not show the path. enter image description here

Correct the entry by entering the correct path along with the file name and it will fix it.

The absence of errors that I suppose comes from the fact that you did not specify anything initially, so it lists AddIn because it is in the registry, although there is nothing to load.

+1
Oct 26 '16 at 3:11
source share

In the end, I persuaded Word to tell me:

  Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateStartupObjectException: Could not create an instance of startup object blaghblagh ---> System.TypeInitializationException: The type initializer for 'foo' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'blah' or one of its dependencies. The system cannot find the file specified. 

After that, thanks to [1], FusLogvw quickly solved the problem for me.

[1] Failed to load the file or assembly or one of its dependencies

0
May 7 '16 at
source share



All Articles