code-analysis
code-analysis copied to clipboard
The action is failing inside windows-2022 (windows-latest) runner
When I tried to run code-analysis inside windows-2022 virtual environment, the action is failing with the following error message:
Error: Error running roslynanalyzers job: 1 of 1
Error: GuardianErrorExitCodeException: roslynanalyzers completed with an Error exit code: 17.
Error: Error running tool 1 of 1: roslynanalyzers
Error: Error running roslynanalyzers job: 1 of 1
Error: GuardianErrorExitCodeException: roslynanalyzers completed with an Error exit code: 17.
Full workflow log: error_log.zip
Same here, but you can use windows-2019
with no problem.
Is there any chance to figure out what's the reason for the issue? Failing on self-hosted
This is failing on a self-hosted runner for me as well.
I found that moving to VS2022 requires adding a few extra settings to the analyzers which are:
- msBuildVersion: 17.0
- msBuildArchitecture: x64 (for msbuild) or DotNet
- setupCommandlinePicker: vs2022
Here is an example:
steps:
- task: RoslynAnalyzers@3
displayName: 'Guardian Dotnet Analyzers (formerly Roslyn Analyzers)'
inputs:
msBuildVersion: '17.0'
msBuildArchitecture: 'x64'
setupCommandlinePicker: 'vs2022'
msBuildCommandline: 'MSBuild.exe $(Build.SourcesDirectory)/src/MySolution.sln ...'