Executing a Windows application within GitHub Actions (Error: The tools version "15.0" is unrecognized)
I am extending a Windows application that analyzes C# code and detects various smells. The extension will also work within GitHub Action. The intent is to analyze the committed code as part of CI cycle using this application. The application is a console application based on .NET framework 4.7.2.
To integrate the application with the GitHub Actions, I put together a yml file (produced below). Everything else works fine but the application fails with the following message.
The tools version "15.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0".
I am using the following yml file. As you may observe, I have added MSBuild to the path, set the environment variable to use version 15, set environment variable VSINSTALLDIR to the Visual Studio 2017 installation, and installed build tools. However, I still get the error. What am I missing?
Name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
# Add MsBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.0
with:
vs-version: '15.0'
- name: env var
run: echo ::set-env name=VSINSTALLDIR::"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"
- name: checking sdk
run: echo ::set-env name=VisualStudioVersion::"15.0"
- name: install build tools
run: |
curl.exe -o buildtools.exe https://download.visualstudio.microsoft.com/download/pr/3e542575-929e-4297-b6c6-bef34d0ee648/639c868e1219c651793aff537a1d3b77/vs_buildtools.exe
.\buildtools.exe --quiet --wait --norestart --nocache --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.UniversalBuildTools --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools
# Runs a set of commands using the runners shell
- name: download DesigniteConsole.exe
run: |
curl.exe -o DesigniteConsole.zip "<download link>"
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('DesigniteConsole.zip','.');}"
- name: Run Designite application (it utilizes GitHub secrets and environment variables)
run: |
.\DesigniteConsole\DesigniteConsole.exe -ci -repo $ -pat $ -k $
cat Designite_output/DesigniteAnalysis.xml
from Recent Questions - Stack Overflow https://ift.tt/32Xj1uQ
https://ift.tt/eA8V8J
Comments
Post a Comment