Skip to content

Updating project to MSTest 4 triggers new analyzer warnings #9767

@mus65

Description

@mus65

Description

When trying to update SSH.NET to MSTest 4, I noticed that the update made new Sonar analyzer warnings appear in the test project, e.g. S5445. If I understand correctly, this analyzer should not run on tests since the scope is set to Main. So I assume something about the scope detection was broken by MSTest 4.

I made a repro here: https://github.com/mus65/sonar-mstest4-repro . With MSTest 4, the warning is triggered for both the app and the test project. With MStest 3, the warning is only triggered for the app.

Reproducer

see https://github.com/mus65/sonar-mstest4-repro

Product and Version

SonarAnalyzer.CSharp 0.15.0.120848

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions