我正在尝试从Microsoft.AspNetCore.All
迁移到Microsoft.AspNetCore.App
。因此,我从.All
中删除了.csproj
软件包,并添加了.App
软件包,如下所示:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.8.1" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="2.1.2" />
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
现在,当我尝试构建项目时,出现以下错误:
The nuget command failed with exit code(1) and error(NU1107: Version conflict detected for Microsoft.AspNetCore.Antiforgery. Reference the package directly from the project to resolve this issue.
Proj A -> Proj B -> Proj C -> Proj D -> Proj E -> Proj F -> Proj G -> Microsoft.AspNetCore.Mvc 2.2.0 -> Microsoft.AspNetCore.Mvc.ViewFeatures 2.2.0 -> Microsoft.AspNetCore.Antiforgery (>= 2.2.0)
我什至没有使用这个软件包,所以我不确定下一步该怎么做。 感谢您的任何帮助。
我的dotnet --info
的结果如下:
dotnet --info
:
.NET Core SDK (reflecting any global.json):
Version: 2.1.403
Commit: 04e15494b6
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.403\
Host (useful for support):
Version: 2.1.5
Commit: 290303f510
.NET Core SDKs installed:
1.1.11 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]