I'm developing an Outlook addin in C# and I'm experiencing some performance issues.
Outlook does not like slow addin and disable them if they start too slowly.
The addin needs to do a web request before being available to the user so it may take some time.
I followed the best practices guide from Microsoft (https://learn.microsoft.com/en-us/visualstudio/vsto/improving-the-performance-of-a-vsto-add-in?view=vs-2019) and put this request in a separate Thread:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
// Create Config and add in a Thread
config = new Config();
Thread InstanceCaller = new Thread(config.InstanceMethod);
InstanceCaller.IsBackground = true;
// Start the thread.
The execution time of the function ThisAddIn_Startup is really short, the function is returned after few ms but it seems Outlook is waiting for the Thread to complete when computing the duration.
Thanks for your help.