[英]DevOps CI pipe is failing claiming Microsoft.Bcl.Build
I have a project that pulls from both public and private NuGet repositories.我有一个从公共和私有 NuGet 存储库中提取的项目。 This works.
这有效。 But what doesn't seem to work is that the build on CI fails because of Microsoft.Bcl.Build, which should have gotten downloaded from the Nuget Restore Step
但是似乎不起作用的是 CI 上的构建由于 Microsoft.Bcl.Build 而失败,这应该是从 Nuget 还原步骤下载的
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'
In the sample above, I have tried both using and removing /p:BclBuildImported=Ignore'
.在上面的示例中,我尝试使用和删除
/p:BclBuildImported=Ignore'
。
The library I am using has BCL ref in it, so I cannot remove that dependancy.我正在使用的库中有 BCL ref,所以我无法删除这种依赖。 And this code falls apart when I switch it to core.
当我将它切换到核心时,这段代码就会崩溃。
Everything does work when I build it in Visual Studio 2019 Ent, and Pro, just refuses to build on MS DevOps, on the Hosted 2017 platform.当我在 Visual Studio 2019 Ent 和 Pro 中构建它时一切正常,只是拒绝在 Hosted 2017 平台上的 MS DevOps 上构建。
Tried fixes, and comment/discussion follow-up since initial post:尝试修复,以及自初始发布后的评论/讨论跟进:
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.
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.
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.
even though all packages are being installed, and the Nuget download shows no errors or skips. Have you tried MS DevOps, on the Hosted 2019 platform, instead of using a 2017 Host? 您是否在Hosted 2019平台上尝试了MS DevOps,而不是使用2017 Host?
I ended up removing all BCL dependencies and built a lot of workarounds.我最终删除了所有 BCL 依赖项并构建了很多解决方法。 This was no minor change.
这不是一个小的变化。 Unfortunately, as this is 2 years ago, I don't have the details of what I did back then.
不幸的是,由于这是 2 年前的事,我不知道当时我做了什么的细节。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.