我有一个项目来自公共和私人NuGet存储库。这有效。但似乎没有用的是,由于Microsoft.Bcl.Build,CI的构建失败了,它应该从Nuget Restore Step下载
trigger:
- master
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- VSTest
- DotNetFramework
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.4.1'
inputs:
versionSpec: 4.4.1
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
feedsToUse: config
nugetConfigPath: .nuget/NuGet.Config
- task: VSBuild@1
displayName: 'Run Build on solution.'
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)" /p:BclBuildImported=Ignore'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
logFileVerbosity: 'diagnostic'
在上面的示例中,我尝试了使用和删除/p:BclBuildImported=Ignore'
。
我使用的库中有BCL参考,所以我不能删除它的依赖性。当我将它切换到核心时,这个代码就崩溃了。
当我在Visual Studio 2019 Ent和Pro中构建它时,一切都工作,只是拒绝在Hosted 2017平台上构建MS DevOps。
从最初的帖子开始尝试修复和评论/讨论后续行动:
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets.
,Nuget下载没有显示任何错误或跳过。您是否在Hosted 2019平台上尝试过MS DevOps,而不是使用2017主机?