ErikEJ / EFCorePowerTools

Entity Framework Core Power Tools - reverse engineering, migrations and model visualization in Visual Studio & CLI
MIT License
2.13k stars 294 forks source link

Exception when Add DbContext Diagram from Shared Project #892

Closed paulyiu closed 3 years ago

paulyiu commented 3 years ago

When Add DbContext Diagram on Shared Project, VS will force quit and reopen, it look like cannot GetOutPutAssemblyPath. image image

Steps to reproduce

create Shared Project then Add DbContext Diagram (any menu item beside Reverse Engineer or About will throw exception) image image

Further technical details

EF Core Power Tools version: Version 2.5.587.0

SQLite ADO.NET Provider included: 1.0.109.0 SQLite EF6 DbProvider in GAC - No

System.Data.SQLite DDEX provider - No SQLite Simple DDEX provider - Yes

Database engine: Oracle Visual Studio version: VS2019

repo: https://github.com/paulyiu/EfCorePowerToolsTest

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
   at System.IO.Path.Combine(System.String, System.String)
   at EFCorePowerTools.Extensions.ProjectExtensions.GetOutPutAssemblyPath(EnvDTE.Project)
   at EFCorePowerTools.EFCorePowerToolsPackage+<LocateProjectAssemblyPathAsync>d__19.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at EFCorePowerTools.EFCorePowerToolsPackage+<OnProjectContextMenuInvokeHandlerAsync>d__18.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at EFCorePowerTools.EFCorePowerToolsPackage+<<InitializeAsync>b__11_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0(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)
ErikEJ commented 3 years ago

Which project do you launch from?

Can you share a repro solution?

paulyiu commented 3 years ago

Startup project is WebApplication1 I launch Add DbContext Diagram from SharedProject1, beside Reverse Engineer and About, other menu item will throw GetOutPutAssemblyPath issue as well. but I can generate entity from SharedProject1.

repo: https://github.com/paulyiu/EfCorePowerToolsTest

image

paulyiu commented 3 years ago

oh, no issue when launch from WebApplication1, thanks @ErikEJ