Troubleshooting Outlook crash caused by my VSTO add in RRS feed

  • General discussion

  • I'm having a tough time troubleshooting a crash, on a handful of customer machines, my VSTO add-in works fine 99% of the time but occasionally the Outlook process becomes unresponsive and crashes, usually while writing or sending new mail. After the process dies my add in crashes and outlook disables it.

    After this crash windows eventlog shows this error:

    Add-in execution error. Outlook crashed during the 'Read' callback of the 'ItemEvents_10' interface while calling into the '<My Addin Name>' add-in. 

    Actually i'm not really sure what is "ItemEvents_10" or where in my code it's supposed to reffer to.

    Any idea what can cause this? or how to trubleshoot or create a crash dump for this error?

    Thank you

    Tuesday, July 9, 2019 5:38 PM

All replies

  • Hello Mikey,

    The record refers to the ItemEvents_10_Event.Read event which is fired when an instance of the parent object is opened for editing by the user. The Read event differs from the Open event in that Read occurs whenever the user selects the item in a view that supports in-cell editing as well as when the item is being opened in an Inspector. Basically, this event is MailItem.Read from the Outlook object model.

    Do you run any secondary threads in Outlook?

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Tuesday, July 9, 2019 5:51 PM
  • Hello Eugene,

    I checked the code & I am not starting any task\thread during the following event (ItemEvents_10_ReadEventHandler Read).
    I am though starting a task when i'm initializing a few view-models of my add-in, to fetch data from an IIS service.

    Do you think it might be an exception thrown during the event? 
    How are secondary threads related to the problem?

    Wednesday, July 10, 2019 9:15 AM
  • Most probably you do something while the Read event is taking place, not in the event handler itself. There is a clash in the add-in which leads to an exception fired. 

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Wednesday, July 10, 2019 9:40 AM
  • Hey again,

    I looked all around my code, and the async methods in it aren't even being called (they are used in specific cases that the users experiencing the crash don't get involved in), which means it's probably not a threads problem.

    Do you have any other idea of places in the code or specific patterns that may cause problems with office?
    maybe some .NET functions that might cause problems with VSTO?

    Also, I read somewhere about Office VSTO add-ins not being thread-safe, so what are the things I should know when involving threads\ tasks in an outlook add-in?

    Thursday, July 11, 2019 1:07 PM