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

2023-09-04 01:01:42 作者:初檬〆

我用我的C#文件的XML文档标题传递了StyleCop规则SA1633。

I am using XML documentation headers on my c# files to pass the StyleCop rule SA1633.

目前,我必须使用2斜线注释规则允许了StyleCop识别头。例如:

Currently, I have to use the 2 slash commenting rule to allow StyleCop to recognize the header. for example:

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

这很好地满足了StyleCop,但我想用三斜线注释规则,使视觉工作室,了解意见XML和提供XML功能(高亮显示,自动缩进等)

This works fine for StyleCop, however I would like to use the 3 slash commenting rule to enable visual studio to understand the comments as XML and provide the XML functionality (highlighting, auto indenting etc)

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

问题是,用3斜线时,了StyleCop再也看不到的头,并引发了SA1633警告。

The problem is that when using 3 slashes, StyleCop no longer see's the header and throws the SA1633 warning.

反正是有配置了StyleCop了解头部使用3斜线包含在XML?

Is there anyway to configure stylecop to understand the header is contained in XML using 3 slashes?

谢谢

亚当

推荐答案

您可以建立一个自定义规则,并禁用新的原赞成: http://scottwhite.blogspot.com/2008/11/creating-custom-stylecop-rules-in-c.html

You could build a custom rule and disable the original in favour of your new one: http://scottwhite.blogspot.com/2008/11/creating-custom-stylecop-rules-in-c.html