Environment:
Visual Studio 2017
Situation:
I'm unable to use a custom Ruleset file in a .NET Standard or .NET Core project. For a .NET Framework project, it's as simple as copying the file into the project, however it is not the case for Core and Standard. Nor do I have the References/Analyzers portion of the project, like you would see in a .NET Framework project, so I'm unable to specify the file manually. I tested this by toggling IDE1006 in the Ruleset file,
CC @sharwell
@tmeschter did you address this already?
@khionu Have you set the <CodeAnalysisRuleSet> property to point to your .ruleset file? It isn't enough to simply include the .ruleset file; the property needs to be set as well.
Wasn't aware of this component of the new CSPROJ format. Is this documented anywhere?
@khionu The <CodeAnalysisRuleSet> property isn't new with the updated CSPROJ; it's been around as long as VS has had support for static analysis. If you don't provide a value for it in your project/targets you'll get a default value that points to a .ruleset file in the VS installation.
@tmeschter I've never had to provide a value for it, "It Just Works TM" with a full .NET Framework project.
So, essentially, the issue is that Visual Studio needs to catch up on the tooling it provides for .NET Standard and .NET Core projects.
I'm not sure where to raise that concern, if it isn't already slated, so a pointer would be appreciated.
@khionu If the issue is fundamentally that VS support for .NET Standard and .NET Core projects is not at parity with other project types, then the dotnet/project-system repo would be the best place to file issues.
I'll open an issue there, then. This did, however, help get my project on track for style consistency, so thank you very much!
Most helpful comment
So, essentially, the issue is that Visual Studio needs to catch up on the tooling it provides for .NET Standard and .NET Core projects.
I'm not sure where to raise that concern, if it isn't already slated, so a pointer would be appreciated.