Visual Studio:警告缺少私有和内部成员的XML文档

时间:2023-01-14 19:06:50

I am using Visual Studio 2005 (VS.8.0) and I am looking to enforce the requirement that all class members, not just the public ones, be documented. While trivial to setup Visual Studio to generate warnings when public, protected, or internal protected members are not documented, I am looking for a way to have the private and internal members throw this same warning. Any suggestions?

我正在使用Visual Studio 2005(VS.8.0),我希望强制要求记录所有类成员,而不仅仅是公共成员。虽然公共,受保护或受内部保护的成员没有记录,但设置Visual Studio以生成警告是微不足道的,我正在寻找一种让私有和内部成员抛出相同警告的方法。有什么建议?

NOTE: I am using warning level 4, am treating Warnings as Errors, and have the Generate XML flag set.

注意:我正在使用警告级别4,将警告视为错误,并设置了生成XML标志。

1 个解决方案

#1


Unfortunately, Visual Studio 2005 doesn't provide a way to enforce XML documentation on private or internal members and types.

遗憾的是,Visual Studio 2005没有提供在私有或内部成员和类型上强制执行XML文档的方法。

I would recommend giving StyleCop a try, but it doesn't support Visual Studio 2005 (in fact, the latest version doesn't even support Visual Studio 2008 anymore, unfortunately). However, StyleCop can be setup to enforce documentation on all members.

我建议尝试使用StyleCop,但它不支持Visual Studio 2005(实际上,最新版本甚至不再支持Visual Studio 2008)。但是,可以设置StyleCop以强制执行所有成员的文档。

But all is not lost as StyleCop is now open source, so you could obtain the source code and use it to inspire your own add-on for Visual Studio 2005 that mimics this particular operation.

但由于StyleCop现在是开源的,所以不会丢失所有内容,因此您可以获取源代码并使用它来激发您自己的Visual Studio 2005插件,模仿此特定操作。

#1


Unfortunately, Visual Studio 2005 doesn't provide a way to enforce XML documentation on private or internal members and types.

遗憾的是,Visual Studio 2005没有提供在私有或内部成员和类型上强制执行XML文档的方法。

I would recommend giving StyleCop a try, but it doesn't support Visual Studio 2005 (in fact, the latest version doesn't even support Visual Studio 2008 anymore, unfortunately). However, StyleCop can be setup to enforce documentation on all members.

我建议尝试使用StyleCop,但它不支持Visual Studio 2005(实际上,最新版本甚至不再支持Visual Studio 2008)。但是,可以设置StyleCop以强制执行所有成员的文档。

But all is not lost as StyleCop is now open source, so you could obtain the source code and use it to inspire your own add-on for Visual Studio 2005 that mimics this particular operation.

但由于StyleCop现在是开源的,所以不会丢失所有内容,因此您可以获取源代码并使用它来激发您自己的Visual Studio 2005插件,模仿此特定操作。