本文介绍了了StyleCop XML文档标题 - 使用3 ///而不是2 //的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用我的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

这篇关于了StyleCop XML文档标题 - 使用3 ///而不是2 //的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 01:43