Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled System.Threading.Tasks.TaskCanceledException when exiting application #95

Open
DaveNay opened this issue Aug 22, 2019 · 2 comments

Comments

@DaveNay
Copy link

DaveNay commented Aug 22, 2019

Library version

2.5.1

Expected behaviour

Properly handle TaskCanceledExceptions.

Actual behaviour

Throws an unhandled exception when exiting application.

image

Steps to reproduce behaviour

  • Open sample application using Visual Studio 2019 16.2.x
  • Run application with debugging
  • Close application

Unhandled exception does not occur every time, may need to repeat (perhaps as many as 12-15 times)

Code to reproduce behaviour

Sample application included.

ToastNotificationTest.zip

Questions

This only seems to happen with Visual Studio 2019 16.2.0 or higher. I did not see this on earlier viersions of vs2019 or vs2017.

image

@DaveNay
Copy link
Author

DaveNay commented Aug 22, 2019

Exception details...

  HResult=0x8013153B
  Message=A task was canceled.
  Source=mscorlib
  StackTrace:
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.Invoke[TResult](Func`1 callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.Invoke[TResult](Func`1 callback)
   at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.Properties.PropertyService.GetPropertyValuesChainInternal(Int64 instanceHandle, Object targetObject)
   at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.Properties.PropertyService.HandlePropertyChainRequest(PropertiesRequestInfo requestInfo)
   at Microsoft.VisualStudio.DesignTools.WpfTap.Networking.ProtocolHandler.HandleMessage[TMessage,TReply](Func`2 callback, Message request)
   at Microsoft.VisualStudio.DesignTools.WpfTap.Networking.ProtocolHandler.<>c__DisplayClass27_0`2.<RegisterMessageObserver>b__0(Message message)
   at Microsoft.VisualStudio.DesignTools.WpfTap.Networking.ProtocolHandler.ProcessInboundMessage(Message message)
   at Microsoft.VisualStudio.DesignTools.WpfTap.Networking.ProtocolHandler.<>c__DisplayClass40_0.<OnMessageReceived>b__0()
   at Microsoft.VisualStudio.DesignTools.WpfTap.Networking.ProtocolHandler.WaitableActionsList.<>c__DisplayClass8_0.<AddAndSignal>b__0(Boolean isCancelled)
   at Microsoft.VisualStudio.DesignTools.WpfTap.Networking.ProtocolHandler.ActionThread(Object list)
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

@DaveNay
Copy link
Author

DaveNay commented Sep 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant