Hello,
First a quick intro: I'm a seasoned .NET / C# developer and I moved from VS 2015 to 2017 a couple of months ago. At that time, I was desperately looking for a freeware code overview VS extension that would be compatible with VS 2017 and I found your CodeNav, which does a very good job. Unfortunately this extension is sometimes unstable. I'm now taking the time to report a few issues I've found so far.
The first blocking issue I had was related to nested #regions, but this has been fixed recently in CodeNav.
The other blocking issues I face crash VS, no less. I've been able to find a 100% repro scenario for only 1 of them, but I'll report all of them anyway.
For the record, I'm using the most recent CodeNav (2.6.141) and the most recent VS 2017 (26430.14).
- Crash when navigating to a bound property from a xaml file.
For this one, I've a repro scenario. VS 2017 has a new feature that allows to navigate to a bound property from a xaml file. When you do this with CodeNav installed and active, VS crashes. I'm attaching a very simple WPF app solution that demonstrates this bug. Just unzip the file, open the solution, open the file "MainWindow.xaml", select the bound property "Greetings" (at line 11) and press F12 ==> VS 2017 crashes! Here's the corresponding EventLog entry:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
at System.Windows.Threading.Dispatcher.VerifyAccess()
at System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty, System.Object)
at CodeNav.Helpers.VisibilityHelper.SetMarginWidth(System.Windows.Controls.ColumnDefinition, System.Collections.Generic.List`1<CodeNav.Models.CodeItem>)
at CodeNav.CodeViewUserControl.BackgroundWorker_RunWorkerCompleted(System.Object, System.ComponentModel.RunWorkerCompletedEventArgs)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(System.ComponentModel.RunWorkerCompletedEventArgs)
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
CodeNavCrash1.zip
- For the other crashes, I've no repro scenario, but I'll give you the corresponding EventLog entries. This might help you identify the other problems.
2.1) Crash 2:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ObjectDisposedException
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
at Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(Int32, Int32[])
at Microsoft.VisualStudio.Platform.WindowManagement.DTE.DocumentWindow.get_DocCookie()
at Microsoft.VisualStudio.Platform.WindowManagement.DTE.DocumentWindow.get_Document()
at Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase.<get_Document>b__27_0()
at Microsoft.VisualStudio.Shell.ThreadHelper.Invoke[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]
at Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase.get_Document()
at CodeNav.CodeViewUserControl.BackgroundWorker_RunWorkerCompleted(System.Object, System.ComponentModel.RunWorkerCompletedEventArgs)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(System.ComponentModel.RunWorkerCompletedEventArgs)
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
2.2) Crash 3:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ObjectDisposedException
at Microsoft.VisualStudio.Text.Outlining.OutliningManager.EnsureValid()
at Microsoft.VisualStudio.Text.Outlining.OutliningManager.EnsureValid(Microsoft.VisualStudio.Text.SnapshotSpan)
at Microsoft.VisualStudio.Text.Outlining.OutliningManager.GetAllRegions(Microsoft.VisualStudio.Text.SnapshotSpan)
at CodeNav.Helpers.OutliningHelper.FindCollapsibleFromCodeItem(CodeNav.Models.CodeItem, Microsoft.VisualStudio.Text.Outlining.IOutliningManager, Microsoft.VisualStudio.Text.Editor.IWpfTextView)
at CodeNav.Helpers.OutliningHelper.OnIsExpandedChanged(System.Object, System.EventArgs)
at CodeNav.Models.CodeClassItem.set_IsExpanded(Boolean)
at CodeNav.Helpers.OutliningHelper.SetRegionIsExpanded(System.Collections.Generic.IEnumerable1<CodeNav.Models.CodeItem>, Microsoft.VisualStudio.Text.Outlining.ICollapsible, Boolean) at CodeNav.Helpers.OutliningHelper.RegionsExpanded(Microsoft.VisualStudio.Text.Outlining.RegionsExpandedEventArgs, System.Collections.Generic.IEnumerable
1<CodeNav.Models.CodeItem>)
at CodeNav.CodeNavMargin.OutliningManager_RegionsExpanded(System.Object, Microsoft.VisualStudio.Text.Outlining.RegionsExpandedEventArgs)
at System.EventHandler`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.__Canon)
at Microsoft.VisualStudio.Text.Outlining.OutliningManager.Expand(Microsoft.VisualStudio.Text.Outlining.ICollapsed)
at Microsoft.VisualStudio.Text.Editor.Implementation.CollapsedAdornment.HandleMouseDoubleClick(System.Object, System.Windows.Input.MouseButtonEventArgs)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
at System.Windows.Controls.Control.OnMouseDoubleClick(System.Windows.Input.MouseButtonEventArgs)
at System.Windows.Controls.Control.HandleDoubleClick(System.Object, System.Windows.Input.MouseButtonEventArgs)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
at System.Windows.UIElement.OnMouseDownThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
I hope this will help you fix the issues.
Best regards,
Didier Prgomet