StyleCop XML文档标题 - 使用3 ///而不是2 //

问题描述 投票:19回答:1

我在c#文件上使用XML文档头来传递StyleCop规则SA1633。

目前,我必须使用2斜杠评论规则来允许StyleCop识别标题。例如:

// <copyright file="abc.ascx.cs" company="MyCompany.com">
//     MyCompany.com. All rights reserved.
// </copyright>
// <author>Me</author>

这适用于StyleCop,但是我想使用3斜杠评论规则使visual studio能够将注释理解为XML并提供XML功能(突出显示,自动缩进等)

/// <copyright file="abc.ascx.cs" company="MyCompany.com">
///     MyCompany.com. All rights reserved.
/// </copyright>
/// <author>Me</author>

问题是当使用3个斜杠时,StyleCop不再看到标题并抛出SA1633警告。

反正有没有配置stylecop来理解使用3斜杠包含在XML中的标题?

c# .net stylecop coding-style
1个回答
12
投票

您可以构建自定义规则并禁用原始规则,以支持您的新规则:http://scottwhite.blogspot.com/2008/11/creating-custom-stylecop-rules-in-c.html

© www.soinside.com 2019 - 2024. All rights reserved.