由于 Microsoft.AspNetCore 包中的版本冲突,Azure DevOps 管道构建失败

克雷格博特

我一直在尝试使用 Azure DevOps 设置适当的 DevOps 管道。我的问题与其他帖子非常相似,但没有解决我的问题:NU1607: Version conflict detected for Microsoft.AspNetCore.Antiforgery. Reference the package directly from the project to resolve this issue. botProj (>= 1.0.0) -> Bot.Builder.Community.Middleware.Typing (>= 1.0.82) -> Microsoft.AspNetCore.Mvc.ViewFeatures (>= 2.1.1) -> Microsoft.AspNetCore.Antiforgery (>= 2.1.1) botProj (>= 1.0.0) -> Microsoft.AspNetCore.App (>= 2.1.0) -> Microsoft.AspNetCore.Antiforgery (>= 2.1.0).)

如果我像建议的那样直接添加此引用,那么它只会给我一个新的引用。我宁愿不必直接添加每一个。

在这篇文章中:如何解决 aspnet core 2.1 中的版本冲突?(2.1.1 >= 2.1.0-rc1-final)

答案表明我只需要<PackageReference Include="Microsoft.AspNetCore.App" />在我的.csproj文件中进行设置我已经这样做了,但仍然得到同样的错误。

在这篇文章中:建议使用dotnet-restore,我相信我已经将其放入我的azure-pipelines.yml但老实说这可能是错误的命令所以我将发布我的管道Azure DevOps 构建管道不断在每个包上产生版本冲突

这是我的azure-pipelines.yml

vmImage: 'windows-2019'

trigger:
- dev/mybranch

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@0

- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '2.2.101'

- task: NuGetCommand@2
  inputs:
    command: 'restore'
    restoreSolution: '**/*.sln'
    feedsToUse: 'config'
    nugetConfigPath: 'ibibot_ops/NuGet.Config'

- task: VSBuild@1
...
- task: VSTest@2
...

我将发布我.csproj的要点:https : //gist.github.com/MilesWilde/e85f08f5bce40fa63222bbdcffc808cc

我也有一个测试,botProj.test.csproj但它似乎不会影响错误,所以除非有意义,否则我不会发布它。

对此的任何帮助表示赞赏。谢谢你。

克雷格博特

这是通过为NugetToolInstaller@0我的管道中任务指定一个版本并使用DotNetCoreInstaller@0. 这是我删除了一些信息的最终 .yml

steps:
- task: DotNetCoreInstaller@0
  displayName: 'Use .NET Core sdk 2.2.101'
  inputs:
    version: 2.2.101
  continueOnError: true

- task: NuGetToolInstaller@0
  displayName: 'Use NuGet 4.9.1'
  inputs:
    versionSpec: 4.9.1

- task: NuGetCommand@2
  displayName: 'NuGet restore'
  inputs:
    command: 'restore'
    restoreSolution: '**/*.sln'
    feedsToUse: 'config'
    nugetConfigPath: './NuGet.Config'

- task: VSBuild@1
...

- task: DotNetCoreCLI@2
...

- task: PublishCodeCoverageResults@1
...

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

AspNetCore中的版本冲突

Azure DevOps构建管道-失败的构建仍将部署到Azure

没有Azure DevOps管道-构建-任务

构建成功,但发布失败-此版本的Microsoft.AspNetCore.All仅与netcoreapp2.2目标框架兼容

Microsoft.AspNetCore.SpaServices由于节点模块map.d.ts而失败

Azure DevOps发布管道每次都会失败

失败:Microsoft.AspNetCore.SpaServices [0]

Azure DevOps构建管道且托管代理失败

Azure DevOps构建管道中的NuGet包还原

在Microsoft托管的Azure Devops构建管道代理上安装Visual Studio 2015工具包(v140)

由于数据分类语句,Azure DevOps DACPAC部署失败

Microsoft Azure devops python管道失败,Bash退出,代码为“ 5”

Docker-在构建中未找到框架microsoft.AspNetCore.App版本'3.1'0

Nuget Restore在Azure DevOps管道上失败

运行pylint时Azure DevOps管道失败

Azure DevOps构建管道:COPY失败:统计信息..无此类文件或目录

由于testhost.dll,Azure-DevOps管道失败

使用构建标记的Azure DevOps发布管道

由于任务':react-native-image-picker:testDebugUnitTest'的执行失败,因此无法使azure持续集成构建管道

当另一个构建已在运行时,Azure DevOps构建管道失败

由于 Maven,简单的 Jenkins 管道构建失败

Azure DevOps 管道中的 NG 构建失败:错误:找不到模块“../internal/operators/audit”

Azure DevOps 与 Microsoft AppCenter

Azure devops 中的 Docker 构建失败并显示消息无法加载文件或程序集“Microsoft.CodeAnalysis,

Azure DevOps 管道 Json 变量替换 - Microsoft.Hosting.Lifetime

AspNetCore AppSettings Azure DevOps

Azure Devops 管道 Jekyll 构建失败

构建失败的 Azure Devops 管道能否在使用 CI 触发时显示上次提交的用户?

Azure DevOps 管道失败:序列不是预期的