我最近发现我的Azure DevOps管道开始出现故障。最初,我以为我已经用最近的更改破坏了它,但是如果我在同一分支上运行相同的提交(注意,我已将master重命名为main ),则它在先前成功的情况下将失败:>
这是我对管道的YAML:
trigger:
- master
pool:
vmImage: 'vs2017-win2016'
steps:
- task: NuGetCommand@2
displayName: "NuGet Restore"
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'select'
- task: MSBuild@1
displayName: "NET 4.0 Build"
inputs:
solution: '**\Expressive.csproj'
configuration: 'Release'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: '**/*.csproj'
testRunTitle: 'Run all tests'
我在构建日志中发现了这个细节:
Errors in D:\a\1\s\Source\CSharp\Expressive\Expressive.Tests\Expressive.Tests.csproj
Unable to resolve 'Microsoft.NETCore.App (>= 3.0.0)' for '.NETCoreApp,Version=v3.0'.
OK https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/2.0.0/microsoft.netcore.dotnethostresolver.2.0.0.nupkg 39ms
OK https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/2.2.0/microsoft.netcore.dotnethostresolver.2.2.0.nupkg 37ms
OK https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/2.1.0/microsoft.netcore.dotnethostresolver.2.1.0.nupkg 38ms
OK https://api.nuget.org/v3-flatcontainer/system.runtime.serialization.json/4.0.2/system.runtime.serialization.json.4.0.2.nupkg 953ms
OK https://api.nuget.org/v3-flatcontainer/system.xml.xpath.xmldocument/4.0.1/system.xml.xpath.xmldocument.4.0.1.nupkg 955ms
因此,总结一下,我可以看到的唯一区别是我将master
重命名为main
的事实。如果这是造成问题的原因,我会感到很惊讶。有没有人看到或能够提供帮助?