pasztorpisti / vs-window-title-changer

Extension to set the title of the Visual Studio IDE using an expression.
https://visualstudiogallery.msdn.microsoft.com/2e8ebfe4-023f-4c4d-9b7a-d05bbc5cb239
MIT License
16 stars 12 forks source link

Crash after clean installation in VS2019 #14

Closed codefox42 closed 5 years ago

codefox42 commented 5 years ago

After a clean installation of Version 2.1.10 to VS2019 16.0.0, Visual Studio crashes a few moments after the "Open project" dialog becomes visible.

The application event log provides this information:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ComponentModel.Win32Exception
   at System.Windows.Forms.NativeWindow+WindowClass.RegisterClass()
   at System.Windows.Forms.NativeWindow+WindowClass.Create(System.String, Int32)
   at System.Windows.Forms.NativeWindow.CreateHandle(System.Windows.Forms.CreateParams)
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.TextBoxBase.CreateHandle()
   at System.Windows.Forms.Control.get_Handle()
   at System.Windows.Forms.RichTextBox.GetPositionFromCharIndex(Int32)
   at VSWindowTitleChanger.ColorizedPlainTextBox.GetCharWidthInTwips()
   at VSWindowTitleChanger.ColorizedPlainTextBox.SetTabStopChars(Int32)
   at VSWindowTitleChanger.TitleSetupEditor..ctor()
   at VSWindowTitleChanger.PackageGlobals..ctor(VSWindowTitleChanger.VSWindowTitleChangerPackage)
   at VSWindowTitleChanger.PackageGlobals.InitInstance(VSWindowTitleChanger.VSWindowTitleChangerPackage)
   at VSWindowTitleChanger.VSWindowTitleChangerPackage.DelayedInit()

Exception Info: System.Reflection.TargetInvocationException
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
   at System.Delegate.DynamicInvokeImpl(System.Object[])
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(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 System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.UserControl.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

Anyway: thank you for your extension and keep up the good work!

pasztorpisti commented 5 years ago

Sorry for the bad user experience and thanks for the report. I could reproduce the issue and uploaded a (hopefully) fixed version (2.1.11). Under vs2019 you might still get a warning because this old plugin uses some deprecated APIs that will be removed from Visual Studio in the near future. I'm going to look at it and switch to newer APIs if it doesn't require a lot of work.

Anyway: thank you for your extension and keep up the good work!

Thank you. A word of caution: this extension is actually a big pile of very old and ugly hacks. I'm not too proud of it and look at it only when I really have to. I should either rewrite or delete/discontinue it. :-D

codefox42 commented 5 years ago

Thank you for the quick fix - version 2.1.11 works on my machine! :-)

A word of caution

Good to know. ;-)