c# – 如何在.net标准项目中获得一个stylecop规则集
发布时间:2020-12-15 22:53:20 所属栏目:百科 来源:网络整理
导读:我们正在尝试使用stylecop规则集为我们的所有项目提供nuget包. 我们获取项目中的文件,但规则集不适用于我们的项目.它仍然使用minimimumrecomended.ruleset. 我们现在拥有的是: Custom.stylecop.props Project ToolsVersion="4.0" xmlns="http://schemas.mic
我们正在尝试使用stylecop规则集为我们的所有项目提供nuget包.
我们获取项目中的文件,但规则集不适用于我们的项目.它仍然使用minimimumrecomended.ruleset. 我们现在拥有的是: Custom.stylecop.props <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <RunCodeAnalysis>true</RunCodeAnalysis> <CodeAnalysisRuleSet>Custom.StyleCop.ruleset</CodeAnalysisRuleSet> </PropertyGroup> </Project> custom.stylecop.targets <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <AdditionalFiles Include="$(MSBuildThisFileDirectory)Contentstylecop.json"> <Link>stylecop.json</Link> </AdditionalFiles> </ItemGroup> </Project> Custom.stylecop.nuspec <contentFiles> <files include="Content/stylecop.json" buildAction="EmbeddedResource" /> </contentFiles> .... <files> <file src="build**" target="build" /> <file src="Content/stylecop.json" target="contentFiles" /> </files> 有没有人在github上有任何想法或例子,我们可以找到一个例子,因为我们找不到任何. 解决方法
在我们的Xamarin.Forms项目中,修复是一个编辑.NET Standard .csproj文件的手动过程.如果有更好的方法,请告诉我!
>首先,在文本编辑器中打开.NET Standard项目(_Notepad) <PropertyGroup> <CodeAnalysisRuleSet>..stylecop.ruleset</CodeAnalysisRuleSet> </PropertyGroup> >(可选)如果要在项目中访问这些文件,可以使用< AdditionalFiles ... />创建一个ItemGroup. <ItemGroup> <AdditionalFiles Include="..stylecop.json" /> <AdditionalFiles Include="..stylecop.ruleset" /> </ItemGroup> 参考 https://github.com/dotnet/roslyn/blob/master/docs/compilers/Rule%20Set%20Format.md (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- xml格式之DTD闲扯
- XML标头中的“encoding”有什么用处?
- Actionscript 2.0 Flash "HD VIDEO" - Investig
- c# – x的含义:键,x:类x:类型x:XAML中的静态
- ios – COCOAPODS验证i386错误
- c# – XNA Keys枚举中的反引号(`)键的名称是什么?
- ruby-on-rails – 在after_commit,:on =>:create中更新属
- postgresql和oracle的UUID char(32)
- Oracle 11g安装和配置教程(图解)-win7 64位
- c – Qt错误:在此范围内未声明`qApp’