VSTO Outlook addin performance

DLadder 21 Reputation points
2020-08-28T09:32:54.453+00:00

Hello,

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.SetApartmentState(System.Threading.ApartmentState.STA);  
  
            InstanceCaller.IsBackground = true;  
  
            // Start the thread.  
            InstanceCaller.Start();  
  
        }  

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.

Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
4,901 questions
{count} votes

Accepted answer
  1. Leon Laude 85,666 Reputation points
    2020-08-28T11:07:14.15+00:00

    Hi,

    Outlook development is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).

    You can ask the experts in the dedicated Outlook for Developers forum over here:
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=outlookdev

    ----------

    (If the reply was helpful please don't forget to upvote or accept as answer, thank you)

    Best regards,
    Leon

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful