none
VSTO Outlook froze outlook when add-in is installed over network path. RRS feed

  • Question

  • Hello, 

    I have an outlook addins that is installed to users from remote shared-drive. For most users it went ok, buy there are couple users who are located internationally that complains that the add-ins winform froze the PC for 30 seconds. I've looked at their machine and when I copy the vsto installer locally, everything seems ok. Is this normal? 

    The add-ins take input from the user and then started three async threads that create multi-calendar events in separate users' calendars. I've also check call-stack and make sure there's no loose locks that requires marshalling. 

    Monday, October 15, 2018 5:34 PM

Answers

  • Actually, I make a customized installer that install add-ins locally and also marshall all the com threads every time a parallel thread has completed. That solves the problem.  
    • Marked as answer by gtg944s Wednesday, October 31, 2018 7:20 PM
    Wednesday, October 31, 2018 7:19 PM

All replies

  • Hi gtg944s,

    What’s the difference between problems PC and others? Could you provide the log information for those froze machines?

    Also, Does the winform access data from remote servers? 

    Please let us know this information so that we could better solve your issue.

    Best Regards,
    Bruce


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Tuesday, October 16, 2018 11:03 AM
    Moderator
  • Hey Bruce, 

    Thanks for the quick reply. I just saw your message few minutes ago. The winform does access data from remote servers. The error log I got is "The following error occured: Error creating windows handle." It doesn't happen everytime, it basically only happens the first time you use the outlook winform to send multiple messages to multiple recipients through multi-threaded processes. 

    There are three threads with the following structure with one of them running a parallel for each loop: 

    var task1 = task.factory.startnew(() =>

     {

    createEmail();

    this.invoke((MethodInvoker)delegate

    {

    box1.Text="please wait";

    });

    });

    var task2 = task.factory.startnew(() =>

     {

    parallel.foreach{<stuff>};

    this.invoke((MethodInvoker)delegate

    {

    box1.Text="please wait";

    });

    });

    var task3 = task.factory.startnew(() =>

     {

    closingemail();

    this.invoke((MethodInvoker)delegate

    {

    box1.Text="please wait";

    });

    });

    Task.Factory.ContinueWhenAll(new[] {task2,task2,task3} task => 

    {

    this.Invoke((MethodInvoker)delegate

    {

    box1.text="closing form goodbye"

    this.close();

    });

    });

    As you can see I'm invoking a lot of box1 to make the winform responsive while all the threads finishing stuff. Looking forward for your thoughts. Thanks



    Thursday, October 25, 2018 11:00 AM
  • Hi gtg944s,

    This may be related to the thread or the network, do you solve the problem?

    Best Regards,

    Bruce


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Tuesday, October 30, 2018 2:06 AM
    Moderator
  • Actually, I make a customized installer that install add-ins locally and also marshall all the com threads every time a parallel thread has completed. That solves the problem.  
    • Marked as answer by gtg944s Wednesday, October 31, 2018 7:20 PM
    Wednesday, October 31, 2018 7:19 PM