Skip to content

StyleCop.json not loaded when using .slnx solution format (VS 18.5.2) #4085

@ScottGurvey

Description

@ScottGurvey

I’m using Visual Studio 18.5.2 with StyleCop.Analyzers 1.2.0-beta.507. I ran into an issue where StyleCop.json is never loaded, even when placed at the repo root and referenced via Directory.Build.props using:

<AdditionalFiles Include="StyleCop.json" />

Symptoms:

  • StyleCop always uses the default placeholder header (Company, etc.)
  • StyleCop.json shows a red X in Solution Explorer
  • Adding <None Include="StyleCop.json" /> does not help
  • Removing/re-adding the file does not help
  • The file is located at the repo root and all projects are under /src
  • Directory.Build.props is definitely being evaluated for other settings

I attempted to create a classic .sln solution to test whether the issue was specific to .slnx, but Visual Studio 18.5.2 repeatedly generated a nested folder and a new .slnx file instead. I was not able to get Visual Studio to generate a .sln solution at all, so I cannot confirm whether .sln would have resolved the issue.

At this point I removed StyleCop.Analyzers from the project, but I wanted to report the behavior in case .slnx is not fully supported or if there is a known limitation with AdditionalFiles or StyleCop.json under the new solution format.

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