如何将文件夹级文档添加到 C# 程序集中?
我:我是 .NET 平台的新手。
问题
在 Java 中,您可以通过创建 package-info.java 或 package.html 文件并将其存储在包文件夹中来向项目添加包级文档。如何使用 Visual Studio 2010 将等效文档添加到 C# 项目中?
背景
我喜欢在我正在处理的源代码项目的包/文件夹级别上下文中编写描述我动机的文档。我已经非常习惯使用各种语言(特别是 Java)的这种工作流程,并且我相信这是记录我的项目的好方法。
Me: I'm a relative new-comer to the .NET platform.
Problem
In Java, you can add package level documentation to your project by creating a package-info.java or package.html file and storing in the package folder. How do I add equivalent documentation to my project in C# using Visual Studio 2010?
Background
I like to write documentation describing my motivations in the package/folder level context of the source code projects that I am working on. I have become very accustomed to this workflow in a variety of languages (specifically Java) and I believe that it is a good way to document my project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
C# 会自动将基于 XML 的三斜杠注释转换为智能感知文档。
当您将项目编译成类库并在另一个项目中引用它时,上面的内容将自动变成有用的工具提示。此外,C# 编译器可以选择生成一个 XML 文件,其中包含所有这些注释以及 DLL。该 XML 文件可以输入 Sandcastle (如前所述)并以 MSDN 样式添加到文档项目中API 参考。
Sandcastle 工具有自己的项目和文档结构,因此,如果您要添加除 XML 生成的 Intellisense 参考之外的任何内容,您将需要启动一个副项目。
C# will automatically turn the XML-based tripple-slash comments into intellisense documentation.
When you compile your project into a class library and reference it in another project, the above will automatically be turned into a useful tooltip. In addition, the C# compiler can optionally produce an XML file with all of these comments alongside your DLL. This XML file can be fed into Sandcastle (as mentioned previously) and added to a documentation project as MSDN-style API reference.
The Sandcastle tool has its own project and documentation structure, so you'll want to start up a side project if you're going to add anything more than the XML-generated Intellisense reference.
.NET 的重点有点不同,它对生成 IntelliSense 信息有很好的支持。文档触手可及。我相信当你使用过VS一段时间的时候你已经熟悉它了,查阅“xml文档”。
离线文档曾经由 NDoc 覆盖,但支持它的人退出了他的项目。 Sandcastle 项目 填补了这个空缺。顺便说一句,这些天似乎也有点迟缓。
The focus is a bit different in .NET, it has very good support for generating IntelliSense info. Documentation at your finger tips. I'm sure you're familiar with it when you used VS for a while, look up "xml documentation".
Off-line docs used to be covered by NDoc but the guy that supported it quit his project. The Sandcastle project took up the slack. Seems to be a bit laggy too these days btw.