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

时间:2010-03-17 16:06:52

标签: c# .net stylecop coding-style

我在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中包含标题?

1 个答案:

答案 0 :(得分:12)

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