I'm new to the asp.net core and I'm developing an MVC App. I encountered an error trying to view entity framework migrations.
PMC command:
PM> get-migrations
Respond:
get-mgrations : The term 'get-mgrations' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ get-mgrations
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-mgrations:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I cant figure out what is wrong. My guess is that perhaps my dotnet framework is corrupted or something
I tried:
dotnet restore
commandnuget
command by identifying that nuget.exe was missing, downloading it and seting PATH to it (I hope You know what I mean)Nothing helped
AdMarket.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<UserSecretsId>aspnet-AdMarket-C5C71703-513A-471A-959E-3C883B2380D5</UserSecretsId>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.17" />
</ItemGroup>
<ItemGroup>
<Folder Include="Areas\Identity\Services\" />
</ItemGroup>
</Project>
And the thing is that this same error occurs on other projects as well.
get-migrations
is not available as command in the Package Manager Console, see Entity Framework Core tools reference - Package Manager Console in Visual Studio for a list of available commands.
You could use the CLI tools, which provide the dotnet ef migrations list command, or inspect the generated files in the Migrations directory manually.