【问题标题】:Build of PCL lib fails with new VS2019 agent?使用新的 VS2019 代理构建 PCL 库失败?
【发布时间】:2019-07-18 14:16:19
【问题描述】:

如果我将 AzureDevOps CI 通道从 Hosted VS2017 代理切换到 Hosted Windows 2019 with VS2019 代理,构建会中断:

##[section]Starting: PowerShell Script
==============================================================================
Task         : PowerShell
Description  : Run a PowerShell script on Windows, macOS, or Linux.
Version      : 2.140.2
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613736)
==============================================================================
Generating script.
Formatted command: . 'd:\a\1\s\build.ps1'
##[command]"C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'd:\a\_temp\23906d3e-3711-4e1b-8106-8a59074e5e3c.ps1'"
Preparing to run build script...
Running build script...
Could not load D:\a\1\s\tools\Addins\Cake.SemVer.3.0.0\lib\netstandard2.0\Cake.SemVer.dll (missing Semver, Version=2.0.4.0, Culture=neutral, PublicKeyToken=null))

========================================
libs
========================================
MSBuild auto-detection: using msbuild version '16.0.360.33175' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\bin'.
##[error]Cake.exe : D:\a\1\s\Source\ZXing.Net\Source\lib\zxing.portable.csproj(341,11): error MSB4226: The imported project 
##[error]"C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Preview\MSBuild\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Also, tried to 
find "Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" in the fallback search path(s) for 

##[error]$(MSBuildExtensionsPath32) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Program Files 

##[error](x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\bin\msbuild.exe.Config". Confirm that the path in the 

##[error]<Import> declaration is correct, and that the file exists on disk in one of the search paths.

##[error]At D:\a\1\s\build.ps1:233 char:1

##[error]+ &$CAKE_EXE $cakeArguments

##[error]+ ~~~~~~~~~~~~~~~~~~~~~~~~~

##[error]    + CategoryInfo          : NotSpecified: (D:\a\1\s\Source...e search paths.:String) [], RemoteException

##[error]    + FullyQualifiedErrorId : NativeCommandError

##[error] 

##[error]PowerShell exited with code '1'.
##[section]Finishing: PowerShell Script

CI 正在尝试构建 this opensource project from githubdev 分支。

这是否意味着 VS2019 现在不支持构建 PCL 项目了?有什么修复建议吗?

【问题讨论】:

    标签: c# .net msbuild azure-devops portable-class-library


    【解决方案1】:

    这是否意味着 VS2019 现在不支持构建 PCL 项目了?有什么修复建议吗?

    根据文档Project migration and upgrade reference for Visual Studio 2019 Preview

    所以,Visual Studio 2019 仍然支持构建 PCL 项目。

    这个问题的原因是Hosted Windows 2019 with VS2019 agent默认没有安装组件.NET Portable Library targeting pack

    您可以查看Visual Studio 2019 Enterprise 了解更多详情。

    要解决此问题,您可以创建私有代理并安装该组件。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2020-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 2016-04-07
      • 1970-01-01
      相关资源
      最近更新 更多