gpt4 book ai didi

.net - Azure Devops Pipeline NuGetCommand 不断失败

转载 作者:行者123 更新时间:2023-12-03 04:11:11 26 4
gpt4 key购买 nike

正如标题所说,它向我显示了这个错误

The nuget command failed with exit code(1) and error(NU1607: Version conflict detected for Microsoft.AspNetCore.Antiforgery. Reference the package directly from the project to resolve this issue.
ManagementStudio (>= 1.0.0) -> ManagementStudio.Data (>= 1.0.0) -> Microsoft.AspNetCore.Mvc (>= 2.2.0) -> Microsoft.AspNetCore.Mvc.ViewFeatures (>= 2.2.0) -> Microsoft.AspNetCore.Antiforgery (>= 2.2.0) ManagementStudio (>= 1.0.0) -> Microsoft.AspNetCore.App (>= 2.1.0) -> Microsoft.AspNetCore.Antiforgery (>= 2.1.0). Errors in d:\a\1\s\ManagementStudio\ManagementStudio.csproj NU1607: Version conflict detected for Microsoft.AspNetCore.Antiforgery. Reference the package directly from the project to resolve this issue. ManagementStudio (>= 1.0.0) -> ManagementStudio.Data (>= 1.0.0) -> Microsoft.AspNetCore.Mvc (>= 2.2.0) -> Microsoft.AspNetCore.Mvc.ViewFeatures (>= 2.2.0) -> Microsoft.AspNetCore.Antiforgery (>= 2.2.0) ManagementStudio (>= 1.0.0) -> Microsoft.AspNetCore.App (>= 2.1.0) -> Microsoft.AspNetCore.Antiforgery (>= 2.1.0).) Packages failed to restore

当我尝试直接在 ManagementStudio 中引用 Microsoft.AspNetCore.Antiforgery 但仍然发生相同的错误时,我真的很困惑。

这是我在 ManagementStudio 中引用的

<PackageReference Include="bootstrap" Version="4.2.1" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.1" PrivateAssets="All" />

这是我在 ManagementStudio.Data 中引用的

<PackageReference Include="HtmlAgilityPack" Version="1.11.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.1">

我还应该引用什么?当我添加更多引用资料时,错误只会变得更糟。例如。除了防伪之外,还要求提供更具体的项目。

最佳答案

我认为问题出在您的 netcoreapp 版本上。您正在引用 Data 项目中的 2.2.0 库,但从错误来看,您的应用程序的目标是 netcoreapp2.1

我建议将其升级到 netcoreapp2.2 或引用 2.1.x 库,因为这些版本匹配。

关于.net - Azure Devops Pipeline NuGetCommand 不断失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56628510/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com