简体   繁体   English

DevOps CI 管道未能声明 Microsoft.Bcl.Build

[英]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:尝试修复,以及自初始发布后的评论/讨论跟进:

  1. Multiple pools have been tried, all failing.尝试了多个池,都失败了。
  2. This does build in VS 2017 & 2019 on pro and enterprise on various desktops.这确实在 VS 2017 和 2019 中构建,适用于各种台式机的专业版和企业版。
  3. The error is 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.即使所有软件包都已安装,并且 Nuget 下载没有显示错误或跳过。
  4. The following fixes have not worked:以下修复没有奏效:
    1. How to bypass Microsoft.Bcl.Build warning 如何绕过 Microsoft.Bcl.Build 警告
    2. What does the Microsoft.Bcl.Build NuGet package do? Microsoft.Bcl.Build NuGet 包有什么作用?

Have you tried MS DevOps, on the Hosted 2019 platform, instead of using a 2017 Host? 您是否在Hosted 2019平台上尝试了MS DevOps,而不是使用2017 Host?

Hosted Windows 2019 with VS2019 VS2019托管Windows 2019

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.

相关问题 如何绕过 Microsoft.Bcl.Build 警告 - How to bypass Microsoft.Bcl.Build warning 无法安装NuGet包Microsoft.Bcl.Build 1.0.14 - Cannot install NuGet package Microsoft.Bcl.Build 1.0.14 Xamarin.Forms (.Net Standard) 中的 Microsoft.Bcl 和 Microsoft.Bcl.Build 不兼容 - Microsoft.Bcl and Microsoft.Bcl.Build in Xamarin.Forms (.Net Standard) Not compatible 在Visual Studio 2017中安装Microsoft.Net.Http时出现Nuget错误Microsoft.Bcl.Build - Nuget Error Microsoft.Bcl.Build while installing Microsoft.Net.Http in Visual studio 2017 警告:所有引用 MyProject.csproj 的项目都必须安装 nuget 包 Microsoft.Bcl.Build - warning : All projects referencing MyProject.csproj must install nuget package Microsoft.Bcl.Build 不使用包恢复,但仍然得到“必须安装nuget包Microsoft.Bcl.Build” - Not using package restore, but still getting “must install nuget package Microsoft.Bcl.Build” VS2017不包含Microsoft.Bcl.Build,但VS2015包含 - VS2017 does not include Microsoft.Bcl.Build, yet VS2015 does 引用子项目的所有项目必须安装NuGet包Microsoft.Bcl.Build(C#/ Windows Phone 7)? - All projects referencing sub-project must install NuGet package Microsoft.Bcl.Build (C#/Windows Phone 7)? 在某些计算机上生成期间未添加对Microsoft.Bcl修补程序库(System.Runtime等)的引用 - References to Microsoft.Bcl patched libraries (System.Runtime, etc) are not added during build on some machines Jenkins构建失败-缺少文件Microsoft.Build.Utilities.Core - Jenkins build failing - missing file Microsoft.Build.Utilities.Core
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM