Ugrás a fő tartalomra

Create html documentation for C# code [closed]

I'm currently working on a C# project and VisualAssist generates these fancy /// <summary></summary> comments for me and I've been using them do document my code.
I assume there must be a way to use these comments to create HTML documentation like those done by Doxygen or Javadoc. How do I do that?

closed as off-topic by Mogsdad, EJoshuaS, Grr, Brian, Wonko the Sane Jan 16 at 21:20

This question appears to be off-topic. The users who voted to close gave this specific reason:
  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Mogsdad, EJoshuaS, Grr, Brian, Wonko the Sane
If this question can be reworded to fit the rules in the help center, please edit the question.
  • Doxygen also works for C#. What's wrong with it? – Etan Mar 9 '13 at 22:04
  • But Doxygen uses different syntax. Since Visual Assist already generates these comments for me I'd rather use them. Edit: actually maybe it supports xml as well, I'll give it a go. – jaho Mar 9 '13 at 22:07 

5 Answers

up vote32down voteaccepted
Doxygen or Sandcastle help file builder are the primary tools that will extract XML documentation into HTML (and other forms) of external documentation.
Note that you can combine these documentation exporters with documentation generators - as you've discovered, Resharper has some rudimentary helpers, but there are also much more advanced tools to do this specific task, such as GhostDoc (for C#/VB code with XML documentation) or my addin Atomineer Pro Documentation (for C#, C++/CLI, C++, C, VB, Java, JavaScript, TypeScript, JScript, PHP, Unrealscript code containing XML, Doxygen, JavaDoc or Qt documentation).
In 2017, the thing closest to Javadoc would probably DocFx which was developed by Microsoft and comes as a Commmand-Line-Tool as well as a VS2017 plugin.
It's still a little rough around the edges but it looks promising.
Another alternative would be Wyam which has a documentation recipe suitable for net aplications. Look at the cake documentation for an example.
  • Docfx worked perfectly for me. I does work for VS2015 as well - just add nuget package docfx.console. – Anton Krouglov Jul 21 '17 at 8:21
  • The most voted answer is from 2009, but today (2017) I would say docfx is the best way to go. – Nikolaos Georgiou Aug 3 '17 at 5:57
  • DocFX has unfortunately the big disadvantage, that it focuses only on documentation ofr the public. So if you want to do some documentation for internal use, which also includes access modifiers "internal" or "private", it is absolute useless. Sure... you have the opportunity to modify the code by yourself and fix this. See: github.com/dotnet/docfx/issues/836 – Onsokumaru Dec 21 '17 at 13:28 
You can generate the XML documentation file using either the command-line compiler or through the Visual Studio interface. If you are compiling with the command-line compiler, use options /doc or /doc+. That will generate an XML file by the same name and in the same path as the assembly. To specify a different file name, use /doc:file.
If you are using the Visual Studio interface, there's a setting that controls whether the XML documentation file is generated. To set it, double-click My Project in Solution Explorer to open the Project Designer. Navigate to the Compile tab. Find "Generate XML documentation file" at the bottom of the window, and make sure it is checked. By default this setting is on. It generates an XML file using the same name and path as the assembly.
You can try https://www.docify.net/ They do exactly this.
The above method for Visual Studio didn't seem to apply to Visual Studio 2013, but I was able to find the described checkbox using the Project Menu and selecting my project (probably the last item on the submenu) to get to the dialog with the checkbox (on the Build tab).

Megjegyzések

Népszerű bejegyzések ezen a blogon

SW Documentation: Requirements

Requirements Nonfunctional Requirements Q&A FEBRUARY 17, 2010  ~  ANDREW STELLMAN ~  3 COMMENTS Non-functional requirements Q&A: We answer questions from readers about using  nonfunctional requirements  on a real software project, and how to use them on a real software project. Non-functional requirements: Planning out how well your software will work A couple of months ago I wrote a post called  Using nonfunctional requirements to build better software . It’s basically a step-by-step guide for creating an easy, practical technique to use nonfunctional requirements on a real software project, treating them in a way that’s similar to how a lot of Agile teams treat user stories, scenarios and other functional requirements: by sticking them on index cards and using them to do some lightweight planning. Since then, I’ve gotten a lot of questions about nonfunctional requirements (or, as some people call them, non functional requirements...

Privacy Notice for Visitors to Our Users’ Sites

Privacy Notice for Visitors to Our Users’ Sites Sections Who’s Who and What This Privacy Notice Covers Information We Collect About Visitors to Our Users’ Sites Information a Visitor Provides to a Site Information We Automatically Collect from the Site Other Information Provided by Our Users How We Use Visitor Information How We Share Visitor Information Other Tools Other Resources Hi there! This Privacy Notice explains how we, at Automattic, process information about the visitors of our users’ websites in connection with the services we provide through WordPress.com, Jetpack (including WooCommerce Services), IntenseDebate, Polldaddy.com, and Akismet. Read on! Who’s Who and What This Privacy Notice Covers Let’s talk first about who we are at Automattic, what we do, and what this Privacy Notice covers. We are the folks behind a variety of products and services designed to allow anyone–from bloggers, to small business owners, and enterprises–to create, publ...

THE RIGHT WAY TO WRITE A SINGLETON

THE RIGHT WAY TO WRITE A SINGLETON July 17, 2015 by   Hector Matos Even though I've written about the woes of managing state in my previous post, sometimes there's just no way we can avoid it. One example of managing state is something we're all quite acquainted with - The Singleton. The problem we find in Swift is that there are SEVERAL ways of implementing them. But which way is the right way? In this post I'm going to show you the history of the singleton and then show you the right way to implement the singleton in Swift. If you want to see the right way to implement the singleton pattern in Swift along with proof of it's "right-ness", you can scroll to the bottom of the post and see it there. :) A TRIP DOWN MEMORY LANE Swift is a natural evolution of Objective-C. In Objective-C, this is how we implemented the singleton: @interface Kraken : NSObject @end @implementation Kraken + ( instancetype ) sharedInstance { ...