TaskCanceledException when debugging

3150
2
Jump to solution
09-11-2018 10:02 AM
StephenRhea
New Contributor III

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.

1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Stephen,

 We have brought this issue to the attention of the Pro development team.  In our observation there are some workflows in ArcGIS Pro (without any add-ins installed) that will produce the same problem you described, so it is actually not related to the API or the SDK.  Hopefully the ArcGIS Pro development team can resolve this issue soon, however, it turns out that this exception (when thrown during shutdown as you described) can be safely ignored in your debugging session by using 'continue debug' or just stopping the debug session (which is what I usually do).  Sorry about the inconvenience.

- Wolf

View solution in original post

0 Kudos
2 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Stephen,

 We have brought this issue to the attention of the Pro development team.  In our observation there are some workflows in ArcGIS Pro (without any add-ins installed) that will produce the same problem you described, so it is actually not related to the API or the SDK.  Hopefully the ArcGIS Pro development team can resolve this issue soon, however, it turns out that this exception (when thrown during shutdown as you described) can be safely ignored in your debugging session by using 'continue debug' or just stopping the debug session (which is what I usually do).  Sorry about the inconvenience.

- Wolf

0 Kudos
StephenRhea
New Contributor III

Thanks for the info, Wolf, and glad to know the Pro dev team knows about it. I'll keep my eyes out for their fix.

0 Kudos