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.
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:
Symptoms:
<None Include="StyleCop.json" />does not help/srcI attempted to create a classic
.slnsolution to test whether the issue was specific to.slnx, but Visual Studio 18.5.2 repeatedly generated a nested folder and a new.slnxfile instead. I was not able to get Visual Studio to generate a.slnsolution at all, so I cannot confirm whether.slnwould have resolved the issue.At this point I removed StyleCop.Analyzers from the project, but I wanted to report the behavior in case
.slnxis not fully supported or if there is a known limitation with AdditionalFiles or StyleCop.json under the new solution format.