AnsweredAssumed Answered

TaskCanceledException when debugging

Question asked by stephengrhea on Sep 11, 2018
Latest reply on Sep 14, 2018 by stephengrhea

I recently upgraded to Pro 2.2 and started getting a TaskCanceledException when I close Pro with a debugger (VS 2015) attached. I created a simple add-in, just a ribbon tab with a dock pane, and now the exception is thrown every time I close Pro with the dock pane open. The dock pane has some controls on it, but no code runs without user interaction. I found this article in the Runtime forums, but can't get the solution to work with Pro: TaskCanceledException on shutdown When Pro runs without a debugger, it closes just fine.

 

Unchecking the "Break when this type of exception is thrown" checkbox isn't working either. Visual Studio ignores that selection, which seems like a bug within VS, but I'd still like to know why the TaskCanceledException is thrown and how to process/ignore it.

 

System.Threading.Tasks.TaskCanceledException was unhandled
Message: An unhandled exception of type 'System.Threading.Tasks.TaskCanceledException' occurred in WindowsBase.dll
Additional information: A task was canceled.

 

*************** Edit ***************

I found more details today. An uncaught error occurred in my dock pane within a QueuedTask. When Pro crashed, the exception message was different (see below). Not sure if they're related, but since tasking is mentioned, I figured they might be. Also of note, that file doesn't exist on my machine, and the inner exception is inaccessible.

 

System.Exception was unhandled
Message: An unhandled exception of type 'System.Exception' occurred in mscorlib.dll
Additional information: Exception while waiting for a Task to complete. Caller: ClearFinishedTasksImpl, File: C:\ArcGIS\ArcGISDesktop\ArcGISEditing\ArcGIS.Desktop.Editing\EditLib\Awaitable.cs, Line: 358. See the inner exception for additional information.

Outcomes