.NET Console App with Entity Framework Core: 'The process has no package identity' only when started without debugging
This is could be an internal exception which is handled by EF Core. You will see this kind of exceptions if you have disabled 'Enable Just My Code' in Visual Studio: Tools -> Options -> Debugging
Enabling this option should fix the issue.
Essentially this will break code execution when exception occurs outside of your code even if handled.
If you hit F5 when the exception occurs it should continue running - this is way your program is running without issues when there is not debugger attached.