dotnet恢复失败:版本冲突。 (.NET Core SDK 2.1.300)

时间:2018-11-19 15:02:57

标签: c# asp.net-core asp.net-core-2.1

我通过在cmd中运行dotnet restore收到此错误

    $ dotnet restore
  Restoring packages for C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassS     urvey1.csproj...
C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj : warning NU1608: Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.0 requires Microsoft.AspNetCore.Razor.Design (= 2.1.0) but version Microsoft.AspNetCore.Razor.Design 2.1.2 was resolved. [C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1.sln]
C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj : warning NU1608: Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.0 requires Microsoft.AspNetCore.SpaServices.Extensions (= 2.1.0) but version Microsoft.AspNetCore.SpaServices.Extensions 2.1.1 was resolved. [C:\     Users\Admin\Desktop\ClassSurvey1\ClassSurvey1.sln]
C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj : warning NU1608: Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.0 requires Microsoft.EntityFrameworkCore (= 2.1.0) but version Microsoft.EntityFrameworkCore 2.1.4 was resolved. [C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1.sln]
C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj : warning NU1608: Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.0 requires Microsoft.EntityFrameworkCore.SqlServer (= 2.1.0) but version Microsoft.EntityFrameworkCore.SqlServer 2.1.4 was resolved. [C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1.sln]
C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj : warning NU1608: Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.0 requires Microsoft.EntityFrameworkCore.Tools (= 2.1.0) but version Microsoft.EntityFrameworkCore.Tools 2.1.4 was resolved. [C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1.sln]
C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj : error NU1107: Version conflict detected for Microsoft.AspNetCore.Antiforgery. Reference the package directly from the project to resolve this issue.  [C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1.sln]
C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj : error NU1107:  ClassSurvey1 -> Microsoft.AspNetCore.SpaServices.Extensions 2.1.1 -> Microsoft.AspNetCore.SpaServices 2.1.1 -> Microsoft.AspNetCore.Mvc.ViewFeatures 2.1.1-> Microsoft.AspNetCore.Antiforgery (>= 2.1.1)  [C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1.sln]
C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj : error NU1107:  ClassSurvey1 -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Antiforgery (= 2.1.0). [C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1.sln]
  Restore failed in 692.51 ms for C:\Users\Admin\Desktop\ClassSurvey1\ClassSurvey1\ClassSurvey1.csproj.

这是我的版本

$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.1.300
 Commit:    adab45bf0c

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.300\

Host (useful for support):
  Version: 2.1.0
  Commit:  caa7b7e2ba

.NET Core SDKs installed:
  2.1.300 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

该项目是我的Web应用程序的后端。问题是我对.NET零知识。只是尝试按照我的朋友的指示,他声称它可以在多台PC上运行(安装.net sdk 2.1.300并运行dotnet restore)

我到底需要安装什么?

0 个答案:

没有答案