cefsharp/cef-binary

VS2019 not found with VS2022 target

mistoll opened this issue · 1 comments

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

if ($_ -eq 'v143')

but I don't understand the variable $_ ($PSItem) in that situation. When replacing $_ with $Toolchain it works as expected.

Sounds like a bug, official builds still use VS2019.

Pull requests welcome.