如何导出 C# / VisualStudio 2008 中的代码文档?
我一直注重使用 C# xml 语法为类和方法编写漂亮的代码注释。 我一直希望以后能够轻松导出它们。
今天我实际上必须这样做,但我不知道如何做。 我有什么遗漏的吗? 我想要进入菜单->构建->构建代码文档,但是没有选项可以做到这一点。
I have always made a point of writing nice code comments for classes and methods with the C# xml syntax. I always expected to easily be able to export them later on.
Today I actually have to do so, but am having trouble finding out how. Is there something I'm missing? I want to go Menu->Build->Build Code Documentation, but there is no option to do that, there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
以前的答案确实已经过时了。 以下是一些更现代的选项:
The previous answers are really out of date. Here are some more modern options:
迟来的评论,但值得补充的是,尽管 Sandcastle 已被封存,Sandcastle 帮助文件生成器仍在积极开发中,并且我发现在处理这种情况时,它非常强大且易于深入研究 - 在几个小时内安装到丰富的 .chm 和 .html/.asp 输出。
Late comment, but worth adding that even though Sandcastle is mothballed, the Sandcastle Help File Builder remains in active development, and I found it very powerful and straightforward to dive into when dealing with just this situation--install to rich .chm and .html/.asp output in a couple hours.
您可以尝试 NDOC 或 SandCastle 如果您不介意使用第 3 方工具。
You could try NDOC or SandCastle if you dont mind using 3rd party tools.
实际上它在项目属性中。 “构建”选项卡、“输出”部分、“XML 文档文件”,然后输入文件名。 它将构建在项目的每次构建上。
之后,您可以使用 沙堡。
Actually it's in the project properties. Build tab, Output section, XML documentation file, and enter the filename. It will be built on every build of the project.
After that you can build the actual help with Sandcastle.
Sandcastle 非常适合生成文档,并且它支持多种不同的生成格式。 据我所知,没有任何 Visual Studio 集成,但有一个 SandcastleGUI 对于可用的。
Sandcastle works pretty well for generating documentation and it supports a couple different formats for the generation. As far as I know, there isn't any Visual Studio integration for it, but there is a SandcastleGUI for it that is available.
如果您使用 LINQ to SQL,请务必小心,因为您将无法轻松地将可持续注释添加到自动生成的对象中。
Be careful if you're using LINQ to SQL as you won't be able to easily add sustainable comments to the auto-generated objects.
原来的 NDoc 项目(其他人提到的)已经死了,但是有一个名为 NDoc3 的新项目。
NDoc3 支持 .NET 2.0 - 3.5。 它目前是测试版,对我来说效果很好。 我不确定该项目是否仍然活跃 - 最后一个测试版于 2009 年 4 月发布。
The original NDoc project (mentioned by others) is dead, but there is a new project called NDoc3.
NDoc3 supports .NET 2.0 - 3.5. It is currently available as a beta version and worked great for me. I'm not sure if the project is still active - the last beta was release in april 2009.