在Visual Studio 2017 .NET Core项目中支持Roslyn分析器(.ruleset) [英] Supporting Roslyn Analyzers(.ruleset) in Visual Studio 2017 .NET Core Projects
问题描述
如何在Visual Studio 2017 .NET Core项目中添加对Roslyn Analyzers(.ruleset)的支持?
在"project.json"中,它是使用buildOptions
配置的:
How to add support for Roslyn Analyzers(.ruleset) in Visual Studio 2017 .NET Core Projects?
In "project.json" it is configured by using buildOptions
:
"buildOptions": {
"additionalArguments": [ "/ruleset:rules.ruleset" ]
},
推荐答案
只需编辑.csproj文件并添加:
<PropertyGroup><CodeAnalysisRuleSet>rules.ruleset</CodeAnalysisRuleSet></PropertyGroup>
Just edit the .csproj file and add:
<PropertyGroup><CodeAnalysisRuleSet>rules.ruleset</CodeAnalysisRuleSet></PropertyGroup>
注意:路径是相对于.csproj文件的.
Note: path is relative to a .csproj file.
此处的原始帖子: https://www.linkedin.com/pulse/supporting-roslyn-analyzers-visual-studio-2017-net-core-jake-brandt
这篇关于在Visual Studio 2017 .NET Core项目中支持Roslyn分析器(.ruleset)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!