我一直在尝试使用 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] 删除。
我来说两句