XML 注释——如何(或在哪里)为命名空间和库创建 XML 注释?
据我所知,如果您在类、字段、方法或属性上方 ///
,Visual Studio 将开始为您建立 XML 样式的注释。
但是,我可以在哪里为我的命名空间和/或库添加 XML 注释...
例如:
我不确定这些是否页面是手动的或者它们是通过在适当位置添加 XML 样式注释自动创建的?
I understand that if you ///
above a class, field, method, or property Visual Studio will start establishing XML-style comments for you.
However, where can I go to add XML comments for my namespaces and/or library...
For example:
I'm not sure if those pages were manually created or if they were automatically created via XML-style comments being added in the proper locations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这取决于您用来生成文档的工具。我相信,使用
NDoc
,您只需在要记录的命名空间内创建一个名为NamespaceDoc
的类即可。然后将使用该类的 XML 注释。由于问题被标记为“sandcastle”,我假设您确实正在使用它。如果是这样,这个答案应该提供详细信息。
更新:好的,我只是(在同一个线程中)看到 Sandcastle 显然也理解 NamespaceDoc 类。有人可能想将这个问题作为重复问题来结束。
That depends on the tool you use to generate your documentation. With
NDoc
, I believe, you simply had to create a class calledNamespaceDoc
inside the namespace you wanted to document. The XML-Comment of that class would have then be used.Since the question is tagged with "sandcastle", I assume you are indeed using it. If so, this SO answer should give the details.
Update: OK, I just (in that same thread) saw that apparently Sandcastle understands NamespaceDoc-classes as well. Somebody might want to close this question as a duplicate.
要生成 xml 文件,您需要在项目属性中将其打开。它是项目属性的
Build
选项卡上的XML 文档文件
复选框。如果打开它并重新编译程序集,程序集旁边将出现一个与该程序集同名的 xml 文件。
然后,您可以使用 sandcastle 等工具为您的代码创建帮助文件。 sandcastle 实际上是一组工具,您可以使用它来自定义生成帮助文件的整个过程。这条路径将需要大量阅读 sandcastle 帮助文件和教程。
沙堡安装的示例文件夹中还隐藏了一个工具,可以让您快速生成帮助文件,但提供的自定义程度较低。
过去我使用过一个名为“DocProject”的 Visual Studio 插件一段时间。我不确定它是否仍然有效,但如果您感兴趣,您可以在 codeplex 上找到它:http://docproject.codeplex。 com/
根据 Microsoft 的说法,您引用的 MSDN 示例不是通过从源代码中提取
///
标签创建的,而是更多地与拆分程序员和文档人员部门有关。别的。To generate the xml file you need to turn it on in your project properties. It's the checkbox
XML documentation file
on theBuild
tab of the project properties.If you turned it on and you re-compile the assembly an xml file will appear next to the assembly with the same name as that assembly.
You can then use a tool like sandcastle to create a helpfile for your code. sandcastle is actually a set of tools you can use to customize the whole process of generating help files. This path will require a lot of reading the sandcastle helpfile and tutorials.
There also is a tool burried in the examples folder of the sandcastle installation that lets you quickly generate a helpfile but offers less cusomization.
In the past i used a visual studio plugin called "DocProject" for a little while. I'm not sure if it still active but you can find it on codeplex if your interested: http://docproject.codeplex.com/
According to Microsoft the MSDN examples you refer to are not created by extracting the
///
tags from their source but that had more to do with splitting the programmers and documenters deparments then anything else.