Open robbmcleod opened 2 months ago
Correct, the version you are looking for must exist, or you will hit a failure as indicated. It is not an acquisition argument, it is a path argument really. See: https://github.com/microsoft/setup-msbuild#specifying-specific-versions-of-visual-studio-optional and https://github.com/microsoft/setup-msbuild#notes-on-arguments noting Using these require you to fully understand the runner environment, updates to the tools on the runner, and can cause failures if you are out of sync.
Any suggestions to make that clearer we are happy to update a remark on the README.
This configuration was working fine until I've got the same error yesterday.
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.10,17.11)'
Do I have to specific an exact version as listed here https://github.com/dotnet/msbuild/releases ? I tried [17.11.4, 17.12) but it also failed
@FabienDanieau see what is available on the hosted agent: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
For hosted you don’t really have an option and will really only have one version so specifying the version isn’t recommended really as noted here: https://github.com/microsoft/setup-msbuild?tab=readme-ov-file#notes-on-arguments
The documentation suggests that one can select an older version of MSBuild by specifying it in the YAML:
However, this does not work on GitHub Actions.
vswhere
returns no result.If we look at the Windows latest config, it seems the problem is likely that no older versions of MSBuild are installed:
https://github.com/actions/runner-images/blob/main/images/windows/toolsets/toolset-2022.json
Is this intended to work only on self-hosted runners? If so the documentation should be more clear.