Visual Studio: Warn on Missing XML Documentation for Private and Internal Members

孤街醉人 提交于 2019-12-10 14:05:14

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/1172871/visual-studio-warn-on-missing-xml-documentation-for-private-and-internal-member

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!