sudden unhandled exception when moving emails in outlook

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

sudden unhandled exception when moving emails in outlook
 
aweber




Posts: 83
Joined: 2013-11-21
One of my users has just started receiving sporadic unhandled exceptions thrown from my add-in when she moves multiple emails from folder to folder in Outlook. Despite performing similar tasks for months with the add-in installed, this started appearing on Friday (Jan 17).

I am looking into whether any kind of windows or O365 patches were installed last week. She is running Win10 Pro, Outlook v1908 build 11929.20516.

This is the stack trace she has sent me:
Exception Source:      Microsoft Outlook
Exception Type:        System.Runtime.InteropServices.COMException
Exception Message:     The operation failed.
Exception Target Site: get_Selection

---- Stack Trace ----
   Microsoft.Office.Interop.Outlook._Explorer.get_Selection()
       SwooperClient2.DLL: N 00000 (0x0) JIT 
   SwooperClient2.AddinModule.adxOutlookEvents_ExplorerSelectionChange(sender As Object, explorer As Object)
       AddinModule.vb: line 1157, col 13, IL 0018 (0x12)
   AddinExpress.MSO.ADXOutlookAppEvents.DoExplorerSelectionChange(explorer As Object)
       SwooperClient2.DLL: N 0018 (0x12) IL 
  ...
  ...
Assembly Full Name:    AddinExpress.MSO.2005, Version=9.4.4644.0, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version:      9.4.4644.0

Exception Source:      
Exception Type:        AddinExpress.MSO.ADXExternalException
Exception Message:     An error has occurred in the code of the add-in.


That line is pretty simple, in fact the entire event/method is here:
    Private Sub adxOutlookEvents_ExplorerSelectionChange(sender As System.Object, explorer As System.Object) Handles adxOutlookEvents.ExplorerSelectionChange
        log.Debug("adxOutlookEvents_ExplorerSelectionChange")
        If (explorer IsNot Nothing) Then
            Me.Selected = CType(explorer, Outlook.Explorer).Selection
        End If
    End Sub


Do the numbers in the stack trace lines (besides the line number) mean anything that can tell me what's going on? Obviously the Explorer window thinks the selection is changing and is firing the event, but this has been no problem for a very long time. Any reports of changes recently in Win10 or O365 patches (or I guess .Net patches) that could account for this sudden issue?

I appreciate any feedback and help with finding the root cause so I can accurately fix it.

-AJ
Posted 22 Jan, 2020 14:33:03 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello AJ,

Explorer.Selection should be wrapped in a try/catch as it throws an exception when in certain folders such as RSS Feeds. The complete list of such folders is unknown. I know that it may depend on the Outlook version used. Say, on on older Outlook version I saw this exception in the root folder of a PST message store.


Andrei Smolin
Add-in Express Team Leader
Posted 23 Jan, 2020 01:58:46 Top
aweber




Posts: 83
Joined: 2013-11-21
OK, thank you. I will try that.

I assumed wrapping it in a Try-Catch would mitigate the exception, but I was wondering what was suddenly causing it in case there was a bigger problem lurking from some update or other factor.

I thank you for the information and reply.

-AJ
Posted 23 Jan, 2020 08:17:28 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 23 Jan, 2020 08:53:51 Top