I am trying to move an MVC 5 app from Windows to Mac. I need to connect it to my SQL Server database (hosted inside a Docker container). The app is building and starting, but it throws this error every time it tries to perform a database action.
The model backing the context has changed since the database was created. Consider using Code First Migrations to update the database.
So I used this post to enable migrations. But now when I try to run dotnet ef migrations add initial
It throws the below error.
/Users/cy/Projects/CallNote 2 Web/CallNote 2 Web.csproj(526,3): error MSB4019: The imported project "/usr/local/share/dotnet/sdk/7.0.100/Microsoft/VisualStudio/v17.0/WebApplications/Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/7.0.100/Microsoft/VisualStudio/v17.0/WebApplications/Microsoft.WebApplication.targets" is correct, and that the file exists on disk. Unable to retrieve project metadata. Ensure it's an SDK-style project. If you're using a custom BaseIntermediateOutputPath or MSBuildProjectExtensionsPath values, Use the --msbuildprojectextensionspath option.
But according to this, I understand that running migrations in this way is only available for EF Core. But my project is not SDK-style. It is ASP.Net MVC 5 targeting Framework 4.7.2 with EF6.
Question 1: How can I run migrations on this project?
Question 2: Why is this project running at all since here it says it is not possible to develop a ASP.Net MVC 5 app on Mac?