cefsharp / cef-binary

NuGet repackaging of the CEF binaries provided by Chromium Embedded Framework
https://cef-builds.spotifycdn.com/index.html
Other
108 stars 87 forks source link

VS2019 not found with VS2022 target #103

Closed mistoll closed 1 year ago

mistoll commented 1 year ago

I'm using build.ps1 with --target vs2022 and get the error:

Starting to build targeting toolchain v143

Targeting v143 using configuration Release on platform (System.Collections.Hashtable.ArchLong)

VSWhere path C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe

2019InstallPath: 

Caught an exception: Visual Studio 2019 was not found
    Exception Type: Microsoft.PowerShell.Commands.WriteErrorException
    Stack Trace: at Die, C:\Users\Jenkins\AppData\Local\Jenkins\.jenkins\workspace\cefsharp\cef-binary\cef-binary-master\build.ps1: line 99
    at Msvs, C:\Users\Jenkins\AppData\Local\Jenkins\.jenkins\workspace\cefsharp\cef-binary\cef-binary-master\build.ps1: line 254
    at VSX, C:\Users\Jenkins\AppData\Local\Jenkins\.jenkins\workspace\cefsharp\cef-binary\cef-binary-master\build.ps1: line 380
    at <ScriptBlock>, C:\Users\Jenkins\AppData\Local\Jenkins\.jenkins\workspace\cefsharp\cef-binary\cef-binary-master\build.ps1: line 746
    at <ScriptBlock>, C:\Users\Jenkins\AppData\Local\Jenkins\.jenkins\workspace\cefsharp\cef-binary\cef-binary-master@tmp\durable-c2e5ba2c\powershellScript.ps1: line 3
    at <ScriptBlock>, <No file>: line 1
    at <ScriptBlock>, <No file>: line 1
powershell.exe : Die : Visual Studio 2019 was not found

This seems to be related to https://github.com/cefsharp/cef-binary/blob/0dd29533e4b65ef38b5707afd610ace53cab4feb/build.ps1#L239 but I don't understand the variable $ ($PSItem) in that situation. When replacing $ with $Toolchain it works as expected.

amaitland commented 1 year ago

Sounds like a bug, official builds still use VS2019.

Pull requests welcome.