If I switch my AzureDevOps CI lane from a Hosted VS2017 agent to a Hosted Windows 2019 with VS2019 agent, the build breaks with:
##[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
The CI is trying to build the dev branch of this opensource project from github.
Does this mean VS2019 doesn't support building PCL projects now? Any suggestion for a fix?
According to the document Project migration and upgrade reference for Visual Studio 2019 Preview:
So, Visual Studio 2019 still support building PCL projects.
The reason for this issue is that the Hosted Windows 2019 with VS2019 agent not install the component
.NET Portable Library targeting packby default:You can check the Visual Studio 2019 Enterprise for some more details.
To resolve this issue, you could create your private agent and install that component.
Hope this helps.