code-analysis icon indicating copy to clipboard operation
code-analysis copied to clipboard

The action is failing inside windows-2022 (windows-latest) runner

Open MahmoudH96 opened this issue 3 years ago • 4 comments

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

MahmoudH96 avatar Feb 20 '22 09:02 MahmoudH96

Same here, but you can use windows-2019 with no problem.

TobiasLoeschVolue avatar Feb 25 '22 11:02 TobiasLoeschVolue

Is there any chance to figure out what's the reason for the issue? Failing on self-hosted

romankarnaukh avatar Sep 21 '22 13:09 romankarnaukh

This is failing on a self-hosted runner for me as well.

AceCoderLaura avatar Oct 31 '22 04:10 AceCoderLaura

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 ...'

katrash avatar May 05 '23 19:05 katrash