Add-In doesn't seem to be initializing

Add-in Express™ Support Service
That's what is more important than anything else

Add-In doesn't seem to be initializing
Initialization 
John Parsons




Posts: 10
Joined: 2020-07-21
We have a problem that has been coming up more and more recently. though its not every time, and cant seem to reproduce when in debug mode. so we have added some logs.
We have an EventHandler for this.AddinInitialize being set in the InitializeComponent() method. We added logs around it to make sure this part of the code is being hit:

// 
            // AddinModule
            // 
            this.AddinName = "xxxOutlookAddin";
            this.RegisterForAllUsers = true;
            this.SupportedApps = AddinExpress.MSO.ADXOfficeHostApp.ohaOutlook;
            System.Diagnostics.EventLog.WriteEntry("Outlook", string.Format(" Pre AddinInitialize"));
            this.AddinInitialize += new AddinExpress.MSO.ADXEvents_EventHandler(this.AddinModule_AddinInitialize);
            System.Diagnostics.EventLog.WriteEntry("Outlook", string.Format("Post AddinInitialize"));
            this.AddinStartupComplete += new AddinExpress.MSO.ADXEvents_EventHandler(this.AddinModule_AddinStartupComplete);
            this.AddinBeginShutdown += new AddinExpress.MSO.ADXEvents_EventHandler(this.AddinModule_AddinBeginShutdown);
            this.OnError += new AddinExpress.MSO.ADXError_EventHandler(this.AddinModule_OnError);

            System.Diagnostics.EventLog.WriteEntry("Outlook", string.Format(" End of InitializeComponent"));


This is all leaving logs in the Event Viewer.

This initialize method:

/// <summary>
        /// Handles the AddinInitialize event of the AddinModule control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void AddinModule_AddinInitialize(object sender, EventArgs e)
        {
            System.Diagnostics.EventLog.WriteEntry("Outlook", string.Format(" ENTERRING AddinModule_AddinInitialize"));
            

            try
            {
                System.Diagnostics.EventLog.WriteEntry("Outlook", string.Format("INSIDE THE TRY AddinModule_AddinInitialize"));
                settings = new Settings(addinRegistryKey);
                
                ...

            }
            catch (Exception ex)
            {
                System.Diagnostics.EventLog.WriteEntry("Outlook", string.Format(" AddinModule_AddinInitialize failed -
{0}-{1}",ex.Message, ex.StackTrace ));
                ShowErrorForm(ex);
            }
            System.Diagnostics.EventLog.WriteEntry("Outlook", string.Format(" EXITING AddinModule_AddinInitialize"));
        }



We are NOT seeing these logs in the event viewer, which leads us to believe that the Event is not being thrown for some reason.
Posted 23 Jul, 2020 09:52:26 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello John,

By default, adxregistrator.log is created/updated when you run the installer to register the add-in. Similarly, adxloader.log is created/updated whenever your add-in loads. I suppose Outlook doesn't load your add-in.

Please reinstall your add-in, start Outlook, and send me copies of these files:

%temp%\{AssemblyProduct attribute; see AssemblyInfo}\adxregistrator.log in the profile of the user who runs the installer
%temp%\{AssemblyProduct attribute; see AssemblyInfo}\adxloader.log in the profile of the user who starts Outlook

Find the support email address in {Add-in Express installation folder}\readme.txt. Make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 23 Jul, 2020 10:09:50 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello John,

Thank you. The logs show the add-in registers and loads correctly.

If this occurs on the development machine, this can be a result of having your add-in registered twice: from the Visual Studio IDE and from an installer. Uninstall the add-in if it is installed, unregister the project, start Outlook and check whether there are traces of your add-in. Then register the add-in anew.

If the issue occurs on a client's machine, make sure you don't have both per-machine and per-user versions of your add-in registered.


Andrei Smolin
Add-in Express Team Leader
Posted 24 Jul, 2020 02:57:27 Top
John Parsons




Posts: 10
Joined: 2020-07-21
there is a registry setting in the USER addin field called ADXStartMode. when it is set to "FIRSTSTART" we are seeing the issue, but when it is set to "NORMAL" the add-in works as expected. unfortunately some users it is set to Normal after a first login, some it does not, so it is causing a break each time they load outlook.
Any ideas as to why it does not get set to NORMAL?
Posted 24 Jul, 2020 10:34:42 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello John,

It is used by the code of Add-in Express to recognize the "very first start" scenario. Once the host application is closed, this value is changed to NORMAL.

Please send me 1) the code of the add-in module, and the InitializeComponent method (it is called from the module's constructor). Any sensitive code or strings can be removed; I need to see 1) declarations, 2) constructor, 3) initial events, 4) settings, 5) etc. I don't need any functional code.

Please find the support email address in {Add-in Express installation folder}\readme.txt. Make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 24 Jul, 2020 10:40:03 Top