dotnet / code-analysis

MIT License
63 stars 19 forks source link

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

Open MahmoudH96 opened 2 years ago

MahmoudH96 commented 2 years ago

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

TobiasLoeschVolue commented 2 years ago

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

romankarnaukh commented 2 years ago

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

AceCoderLaura commented 2 years ago

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

katrash commented 1 year ago

I found that moving to VS2022 requires adding a few extra settings to the analyzers which are:

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