Visual Studio:警告缺少专用和内部成员的XML文档 [英] Visual Studio: Warn on Missing XML Documentation for Private and Internal Members

查看:77
本文介绍了Visual Studio:警告缺少专用和内部成员的XML文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2005(VS.8.0),并且希望强制要求记录所有类成员(而不仅仅是公共成员)。在不记录公共成员,受保护成员或内部受保护成员的情况下,设置Visual Studio生成警告很简单,但我正在寻找一种使私有成员和内部成员抛出相同警告的方法。有建议吗?

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?

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

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

推荐答案

不幸的是,Visual Studio 2005没有提供一种对私有或内部成员和类型强制执行XML文档的方法。

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

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

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的附加组件。

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.

这篇关于Visual Studio:警告缺少专用和内部成员的XML文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆