GFlisch / Arc4u.Guidance.Doc

Other
5 stars 1 forks source link

(Guidance 2022.2.1.14) Visual Studio crashes during EF Core project generation via the Guidance #244

Open HaGGi13 opened 1 month ago

HaGGi13 commented 1 month ago

Describe the bug

When trying to add an EF Core database project to an existing component within a solution, an empty modal appears and Visual Studio stops responding.
It is not possible to interact with the modal, e.g. to move or close it. After a while - time was not stopped - Visual Studio crashes completely.
When checking for changes, it was found that nothing had been changed - neither the solution file nor the source code itself.

To Reproduce

Prerequisites:

Steps to reproduce the behavior:

  1. Add EfCore database project to Micro-Service a component
    1. Right click on Micro-Service solution folder (e.g.: Calculation)
    2. Select Add an EfCore database project
  2. Enjoy how Visual Studio crashes after a while :boom:

Expected behavior

A EF Core database project incl. the migration tool was properly added to the target component, regardless of the environment I'm working in (BE vs. DE).

Screenshots

The following screenshot presents the steps to reproduce at once: image

After selecting the context menu entry, the following modal shows up and from than Visual Studio and the modal stop responding: image

The following Windows event log entry was created immediately as the context menu to add an EF Core project was selected. As it is usually more practical to be able to copy something from the stacktrace for troubleshooting, the stacktrace has also been added as text in the "Additional context" section. image

Desktop (please complete the following information)

Additional context

Please find following Windows error event entry that was created instantly the Add an EfCore database project menu entry was clicked:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
   at System.Data.Common.DbConnectionOptions.ParseInternal(System.Collections.Hashtable, System.String, Boolean, System.Collections.Hashtable, Boolean)
   at System.Data.Common.DbConnectionOptions..ctor(System.String, System.Collections.Hashtable, Boolean)
   at System.Data.SqlClient.SqlConnectionString..ctor(System.String)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(System.String, System.Data.Common.DbConnectionOptions)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(System.Data.Common.DbConnectionPoolKey, System.Data.ProviderBase.DbConnectionPoolGroupOptions, System.Data.Common.DbConnectionOptions ByRef)
   at System.Data.SqlClient.SqlConnection.ConnectionString_Set(System.Data.Common.DbConnectionPoolKey)
   at System.Data.SqlClient.SqlConnection.set_ConnectionString(System.String)
   at System.Data.SqlClient.SqlConnection..ctor(System.String, System.Data.SqlClient.SqlCredential)
   at GuidanceCore.AddSqlDatabaseDialog.ReadDatabses()
   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.Controls.ComboBox.OnSelectionChanged(System.Windows.Controls.SelectionChangedEventArgs)
   at System.Windows.Controls.Primitives.Selector+SelectionChanger.End()
   at System.Windows.Controls.Primitives.Selector+SelectionChanger.SelectJustThisItem(ItemInfo, Boolean)
   at System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
   at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
   at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
   at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
   at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
   at System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty, System.Object, System.Windows.PropertyMetadata, Boolean, Boolean, System.Windows.OperationType, Boolean)
   at System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty, System.Object)
   at GuidanceCore.AddSqlDatabaseDialog.AddDatabaseDialog_Loaded(System.Object, System.EventArgs)
   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.BroadcastEventHelper.BroadcastEvent(System.Windows.DependencyObject, System.Windows.RoutedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(System.Object)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
   at System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(MS.Internal.Interop.WindowMessage, IntPtr, IntPtr)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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)