You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make it clear that you may need to change the startup project #2270
I was adding EF Core support to an existing Solution that contained multiple projects, which included both a Main UI (WinForms) project (which is also set as the startup project), and all the database access code in a separate project.
While i was able to easily create an InitialCreate migration in Package Manager Console by ensuring i have the DAL project selected, i have just wasted 4 hours trying to work out why Update-Database doesnt work (kept failing with a NullReferenceException). I eventually discovered that I had to change the Startup Project from the WinForms project to the Database Project before it would work. The simplistic examples you present here dont have that problem because unlike any commercial software development, everything is in the one single project rather than separated. So can you please make it much clearer that you have to change the Startup Project. Thanks!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 6e28b0a8-b7e4-4c07-9e60-0df403bbee28
Version Independent ID: 12300b31-6f7b-b75c-970d-693365e77013
Activity
lohoris-crane commentedon Apr 17, 2020
Instead of changing the startup project, you might simply be able to use the argument
-ProjectNameWaveslam commentedon Aug 11, 2026
Expand and clarify migrations guidance. (dotnet#5445)