无法在ubuntu中还原.net应用程序

无法在ubuntu中还原.net应用程序,ubuntu,asp.net-core-2.0,Ubuntu,Asp.net Core 2.0,net webapi中的核心应用程序。我正在尝试在ubuntu中部署解决方案。下面是我的解决方案。 我把dotnetcore称为 sudo apt-get install dotnet-dev-1.0.1 但我使用的是visual studio 2017和dot net core 2.0 我从以下步骤开始 cd ~/source git clone https://github.com/NiranjanAbb/TestRest.git dotnet restore 每当我尝试恢复时,我都会

net webapi中的核心应用程序。我正在尝试在ubuntu中部署解决方案。下面是我的解决方案。

我把dotnetcore称为

sudo apt-get install dotnet-dev-1.0.1
但我使用的是visual studio 2017和dot net core 2.0

我从以下步骤开始

cd ~/source
git clone https://github.com/NiranjanAbb/TestRest.git
dotnet restore
每当我尝试恢复时,我都会遇到以下错误

/usr/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): error : Package Microsoft.AspNetCore.Antiforgery 2.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Antiforgery 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0) [/home/niranjan/source/TestRest/TestRest.sln]
下面是我的.csproj文件代码

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

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.1" />
  </ItemGroup>

</Project>

netcoreapp2.0
下面我还附上了错误的截图

我还不熟悉ubuntu环境和asp.net内核。有人能帮我找出这个问题的根本原因吗

非常感谢您的帮助


谢谢

请尝试将.csproj文件中的框架设置更改为“.netstandard2.0”。谢谢。我还安装了dotnet作为sudo apt get install dotnet-dev-1.0.1。我应该升级到2.0吗?我只使用过CentOS发行版。只使用了2.0。你也可以试试。你试过一个新的mvc吗?没有。我创建了webapi项目。我应该运行dotnet新mvc吗?