Unable to find MSBuild on hosted runners
See original GitHub issueThe MSBuild dependency step keeps failing.
This is from my GitHub-actions YML file:
The host is a Windows_Server-2019
VM on AWS
VS flavour installed is Visual Studio 2019 Community Edition with License: Visual Studio Community
- name: Dependency - MSBuild
uses: microsoft/setup-msbuild@v1.0.1
with:
vswhere-path: 'C:\Program Files (x86)\Microsoft Visual Studio\Installer'
resulting in the error in the step:
Run microsoft/setup-msbuild@v1.0.1 “C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe” -products * -requires Microsoft.Component.MSBuild -property installationPath -latest ##[error]Unable to find MSBuild.
I did add MSBuild
location in the system path variable as well.
What am I missing? Thanks for the consideration
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Unable to find msbuild. · Issue #7 · microsoft/setup- ...
I am trying to run this action on a self-hosted runner. - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.0.0 with: vs-version: 15.0.
Read more >Azure Pipelines: Msbuild & Vstest cannot find msbuild 15 and ...
Hi,. I am building a pipeline in azure to build a solution in one of our On Prem VM's. The msbuild task cannot...
Read more >Path to MSBuild
To see what gets used if you type msbuild at the command line, do this: where msbuild . If that's not reporting the...
Read more >VSBuild@1 - Visual Studio build v1 task
Use this task to build with MSBuild and set the Visual Studio version property. Learn more about installing Visual Studio images on Azure....
Read more >Building Tooling With GitHub Actions | by James
We need to build our application using MSBuild, on a Windows host. We can use the “windows-latest” tag to specify that this job...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re using a different action:
warrenbuckley/Setup-MSBuild@v1
. You’d need to either replace that withmicrosoft/setup-msbuild@v1
or file an issue on https://github.com/warrenbuckley/Setup-MSBuild. I may be biased since I was the VS setup architect and wrote vswhere, but I’d recommend this one which @timheuer does a great job of keeping up to date.@caibinwav123456 If you are using GitHub’s agents, you don’t need to specify the version flag…as there is only one version of Visual Studio on
windows-latest
so you’ll get that one. And if you are using the hosted agents, no you don’t have direct access to the machine. If you haven’t used MSBuild locally you may want to familiarize yourself with the commands as you’ll still need to specify them. You can test locally by runningmsbuild <path-to-your-solution-or-project>
and add whatever options you need (configuration, etc.). You can see an example here (although this adds web publishing) https://github.com/timheuer/SimpleFrameworkApp/blob/master/.github/workflows/build.yml#L34