VSTO Add-In Loading Twice

  • Thread starter Thread starter Paulem0071
  • Start date Start date
P

Paulem0071

All,

I have posted here before and received great advice. However, I am writing a
VSTO Outlook Add-In, and still have an issue where the Add-In loads twice
When debugging and sometimes starting Outlook 2007.

I have tried Mutex, registry checking and a variety of other methods to no
avail.

Any suggestions? My goal is to ensure only one copy of my Add-In loads and
executes. I have confired the Add-In is loading twice as "ThisAddIn_Startup"
is fired two times.

Thank you.
 
Check in the registry under HKCU\Software\Microsoft\Office\Outlook\Addins
and make sure it's not registered twice, possibly under different clsid's or
names.
 
Are you using Form Regions? I have seen this issue reported by two other
both using Form Regions.

Dave
 
Yes it can that the Startup is fired twice

Hello,

I confirm this happens. The fololwings conditions fire the start-up twice even for a MS Sample:
  1. Your startup Folder is not "Outlook today".
  2. You use a form region in the reading pane.
  3. The reading pane is active for your startup folder.
  4. The form region has to be displayed for the first item of your startup folder.
What I can also state is that it is not the same instance of the add-in that get started. To know if it was the same instance or not, i did use a private static counter I increment each time the Startup event were fired in the ThisAddIn class and some Debug.Print statements. The counter never increments.

But adversely, you get only one shutdown like if the first startup creates a kind of "shadow" addin.

It seems obvious that is not a feature...
 
Not using form regions.

However, here is how I solved it:

Started a brand spanking new VSTO Solution and Project, then cut and pasted
my source code back in class by class. Tedious, but it worked.
 
Back
Top