Efcore: add-migration : The term 'add-migration' 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.

Created on 24 Sep 2019  路  5Comments  路  Source: dotnet/efcore


When trying to create a new Migration in Visual Studio 2019
add-migration SomeMigrationName

this throws an error. "add-migration : The term 'add-migration' 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."

this used to work fine before I upgrade to Version 16.3.0 Preview 4.0

Steps to reproduce

Upgrade VS 2019 to Version 16.3.0 Preview 4.0

Dotnet Version. 3.0.100-rc1-014190

EF Library Project
<ItemGroup> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0-rc1.19457.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0-rc1.19456.14" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.0-rc1.19456.14"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-rc1.19456.14" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="2.0.0-preview1-final" /> </ItemGroup>

WebApi Project
<ItemGroup> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-rc1.19457.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.0-rc1.19456.14"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0-rc1.19456.10" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.5" /> </ItemGroup>

Further technical details

EF Core version: 3.0.0-rc1.19456.14
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .net core 3.0.100-rc1-014190
Operating system: Windows 10 Prop
IDE: Visual Studio 2019 Version 16.3.0 Preview 4.0

closed-question customer-reported

Most helpful comment

Should fix the issue if you add the package Microsoft.EntityFrameworkCore.Tools

All 5 comments

Should fix the issue if you add the package Microsoft.EntityFrameworkCore.Tools

Microsoft.EntityFrameworkCore.Tools fixed it.

I worked with Microsoft.EntityFrameworkCore.Tools fixed it.

Microsoft.EntityFrameworkCore.Tools fixed it. Thanks.

Microsoft.EntityFrameworkCore.Tools 3.1.10 fixed it.

Was this page helpful?
0 / 5 - 0 ratings