将实体框架项目升级到最新的netcore SDK

时间:2019-04-24 14:59:28

标签: asp.net-core entity-framework-core

我下载并安装了最新的.NetCore SDK(2.2.203),可在带有Razor页面的Entity Framework项目中使用。我的项目是使用NetCore 2.1 SDK创建的。

在我的csproj文件中,我看到了这些引用。

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

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

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />
    <PackageReference Include="PagedList.Mvc" Version="4.5.0" />
    <PackageReference Include="System.ServiceModel.Duplex" Version="4.4.*" />
    <PackageReference Include="System.ServiceModel.Http" Version="4.4.*" />
    <PackageReference Include="System.ServiceModel.NetTcp" Version="4.4.*" />
    <PackageReference Include="System.ServiceModel.Security" Version="4.4.*" />
  </ItemGroup>

  <ItemGroup>
    <WCFMetadata Include="Connected Services" />
  </ItemGroup>

</Project>

我更改了这一行:

 <TargetFramework>netcoreapp2.1</TargetFramework>

到netcoreapp.2.2,但随后出现此错误:

  

当前.NET SDK不支持定位.NET Core 2.2。

如何将项目升级到最新的NetCore和Entity Framework版本?

谢谢!

0 个答案:

没有答案