Your startup project 'UnitTestNet6' doesn't reference Microsoft.EntityFrameworkCore.Design.

执行这个命令

dotnet ef dbcontext scaffold "connection string" Microsoft.EntityFrameworkCore.SqlServer -o ./EntityFrameworkTest/Models -t dbo.Test

 

报错1

Your startup project 'UnitTestNet6' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.

需要安装Microsoft.EntityFrameworkCore.Tools

 

报错2

Unable to find provider assembly 'Microsoft.EntityFrameworkCore.SqlServer'. Ensure the name is correct and it's referenced by the project.

需要安装Microsoft.EntityFrameworkCore.SqlServer

 

 <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.5" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5">

posted @ 2022-11-11 11:35  ChuckLu  阅读(441)  评论(0)    收藏  举报