Visual Studio:针对私有和内部成员缺少 XML 文档发出警告

发布于 2024-07-28 21:32:59 字数 205 浏览 3 评论 0 原文

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

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

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?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ヅ她的身影、若隐若现 2024-08-04 21:33:52

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

我建议尝试 StyleCop,但它不支持 Visual Studio 2005(事实上,StyleCop 可以设置为对所有成员强制执行文档。

但一切并没有丢失,因为 StyleCop 现已开源,因此您可以获得源代码并用它来激发灵感您自己的 Visual Studio 2005 附加组件可模仿此特定操作。

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

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.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文