C
C#3mo ago
morry329#

Create Migration always fail

So I wanted to create a SQL Server database table based on your C# model. I have typed down dotnet ef migrations add InitialCreate but it never gets to migrate. The dotnet build shows no noticeable errors like this
PM> dotnet ef migrations add InitialCreate
Build started...
Build failed. Use dotnet build to see the errors.
PM> dotnet build
MSBuild version 17.7.1+971bf70db for .NET
Determining projects to restore...
All projects are up-to-date for restore.
CRUD_HomeFinder -> C:\Users\Mami Kawamura\Source\Repos\CRUD_HomeFinder\CRUD_HomeFinder\bin\Debug\net6.0\MVCCore.dll

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:02.35
PM> dotnet ef migrations add InitialCreate
Build started...
Build failed. Use dotnet build to see the errors.
PM> dotnet build
MSBuild version 17.7.1+971bf70db for .NET
Determining projects to restore...
All projects are up-to-date for restore.
CRUD_HomeFinder -> C:\Users\Mami Kawamura\Source\Repos\CRUD_HomeFinder\CRUD_HomeFinder\bin\Debug\net6.0\MVCCore.dll

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:02.35
` The link to all other database-related code https://pastebin.com/qFyNtM04 Could anyone point me in the right direction?
Pastebin
//DbContextpublic class HomeFinderContext : DbContext{ public HomeF...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
3 Replies
Keswiik
Keswiik3mo ago
Is this a solution with multiple projects in it? And have you tried cleaning the project through VS / Rider / whatever IDE you're using?
morry329#
morry329#3mo ago
No, it is a solution with a single project. Please bear with this question back: what do you mean by cleaning the project? dotnet build does not do it?
Keswiik
Keswiik3mo ago
I mean dotnet clean or using the equivalent option in your IDE's UI.