添加迁移时,未在项目上安装EntityFramework软件包

时间:2018-08-05 19:43:06

标签: c# entity-framework

尽管我已经安装了EntityFramework,但仍收到以下错误消息。

  

PM>初始添加迁移

     

EntityFramework软件包未安装在项目'Common.Persistence'上。

有人可以帮我排序吗?

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.0" />
    <PackageReference Include="Microsoft.Extensions.Options" Version="2.1.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Common.Models\Common.Models.csproj" />
  </ItemGroup>

</Project>

1 个答案:

答案 0 :(得分:0)

在程序包管理器控制台中,请确保选择正确的项目进行迁移。