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

VS UI PM XAML Events should catch unhandled exceptions & not crash VS #10106

Open
donnie-msft opened this issue Oct 2, 2020 · 2 comments
Open

Comments

@donnie-msft
Copy link
Contributor

Evaluate PMUI control events that aren't handling exceptions and causing VS to crash.

One example:
Note I have been working with InfiniteScrollList for dev and using my Experimental VS.
Here's the VS Crash:
image

System.ArgumentOutOfRangeException
HResult=0x80131502
Message=Specified index is out of range or child at index is null. Do not call this method if VisualChildrenCount returns zero, indicating that the Visual has no children.
Parameter name: index
Actual value was 0.
Source=PresentationFramework
StackTrace:
at System.Windows.FrameworkElement.GetVisualChild(Int32 index)
at System.Windows.Media.Visual.InternalGet2DOr3DVisualChild(Int32 index)
at System.Windows.Media.VisualTreeHelper.GetChild(DependencyObject reference, Int32 childIndex)
at NuGet.PackageManagement.UI.InfiniteScrollList.List_Loaded(Object sender, RoutedEventArgs e) in C:\NuGet.Client\src\NuGet.Clients\NuGet.PackageManagement.UI\Xamls\InfiniteScrollList.xaml.cs:line 694
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

This exception was originally thrown at this call stack:
[External Code]
NuGet.PackageManagement.UI.InfiniteScrollList.List_Loaded(object, System.Windows.RoutedEventArgs) in InfiniteScrollList.xaml.cs
[External Code]

@nkolev92
Copy link
Member

@donnie-msft

Can we maybe narrow the scope here to specific areas?
In particular maybe this issue can track the stack you posted.

@nkolev92 nkolev92 added the Priority:2 Issues for the current backlog. label Oct 22, 2020
@donnie-msft
Copy link
Contributor Author

@nkolev92 Of course. When the work is picked up, it can be broken into subtasks. Making this an epic should solve the concern.

@donnie-msft donnie-msft changed the title PMUI should catch unhandled exceptions and not crash VS PMUI XAML Events should catch unhandled exceptions & not crash VS Nov 3, 2020
@donnie-msft donnie-msft changed the title PMUI XAML Events should catch unhandled exceptions & not crash VS VS UI PM XAML Events should catch unhandled exceptions & not crash VS Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants