ArvidsonFoto MVC NET8
1.0.0
Neuaufbau von ArvidsonFoto mit MVC und .NET8 (Upgrade von .NET5 auf .NET6 auf .NET8)
Um die Website zu starten, müssen Sie einige Schritte ausführen.
modelBuilder.InitialDatabaseSeed();
(ca. Zeile 163) in /ArvidsonFoto/Data/ArvidsonFotoDbContext.cs , um eine neue Datenbank mit den zugehörigen Daten erstellen zu können.dotnet ef database update --context ArvidsonFotoDbContext
dotnet ef database update --context ArvidsonFotoIdentityContext
Um eine neue Migration zu erstellen, wenn ein Datenmodell geändert wird, führen Sie den folgenden Befehl aus: dotnet-ef migrations add DatabaseSeed --context ArvidsonFotoDbContext
Wenn Sie beim Ausführen von: dotnet-ef database update
eine Fehlermeldung erhalten, die besagt:
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a build-in dotnet command.
* You intended to execute a .NET program , but dotnet-ef does not exist.
* You intended to run a global tool, but dotnet-prefixed executable with this name could not be found on the PATH.
Anschließend müssen Sie die Dotnet-EF-CLI (Dotnet Entity Framework) installieren, die über den folgenden Befehl installiert wird:
dotnet tool install --global dotnet-ef
Aktualisieren Sie Ihr dotnet-ef mit dem folgenden Befehl auf Version 8.0.0 oder höher:
dotnet tool update --global dotnet-ef