InfoQ

News

Sandcastle: Generate .NET API Documentation

Posted by Abel Avram on Feb 04, 2008 06:02 AM

Community
.NET
Topics
Artifacts & Tools
Tags
Sandcastle,
Documentation

Sandcastle is a Microsoft tool used to create MSDN like API documentation by reflecting over the source code assemblies and adding the XML comments included in the code. A new version of Sandcastle has just been released on CodePlex. The source code of the tool is available on CodePlex under the Microsoft Public License. Documenting the API is a highly recommended practice, even if the API is not made public, because the documentation will certainly be used internally by other developers. Such documentation is absolutely necessary if the API is to be made public.

Sandcastle was first announced back in 2006, and it has been in development for more than 2 years. There are currently only CTP releases, but a "1.0" release is to come in the near future. Another API documentation tool came from the open source NDoc project, whose development was discontinued a couple of years ago on announcement about Microsoft's desire to create Sandcastle. Other projects were built upon the legacy left by NDoc, like NDoc 2005 and NDoc3, but they are only in alpha development.

Sandcastle produces output similar to MSDN documentation as shown in this example. The key features of Sandcastle are:

  • Works with or without authored comments
  • Supports generics and .NET 2.0 Framework
  • Is used internally by Microsoft to generate the .NET Framework documentation
  • It can generate Visual Studio 2005, hana or prototype (CHM, HxS) types of documents

Sandcastle can be used from the command line or from a GUI to build the documentation. Instructions on using it can be found here. Sandcastle is a stand alone tool, so it works with any Visual Studio projects. There are plans to integrate it with Visual Studio, but a final decision has not been made yet. This version runs both on 32 bit and 64 bit machines.

2 comments

Reply

Ndoc by Francois Ward Posted Feb 4, 2008 11:56 AM
Good comments can't be replaced by automated tools by Jim Leonardo Posted Feb 4, 2008 4:47 PM
  1. Back to top

    Ndoc

    Feb 4, 2008 11:56 AM by Francois Ward

    Was NDoc development really discontinued because of the announcement of Sandcastle? I didn't follow this whole thing in a bit, but back then, NDoc's development was stalling because of author-related reasons (I beleive he asked for help and not enough people did or something? Among other things? I forget...), and then Microsoft's blogs, community forums, and all these outlets started being -flooded- with requests for Microsoft to give us a tool like Javadoc for Java (that is, built in). Eventually they caved in and announced Sandcastle. May not be how it went, but its the way I saw it.

  2. I hope this for packaging purposes and isn't intended to produce the following: Method name: GetUserFromProfile Documentation : Gets the user from the profile. That's useless at best (you got all that from the descriptive method name). At worst, its being passed of as proper documentation so some slacker programmer who never comments code can say they do documentation and thereby bamboozle some overloaded manager who has to make sure 10 developers are producing everything they are supposed to. Of course, said slacker also probably came up with a method name that was more along the lines of GetUser or gusr.

Exclusive Content

Rationalizing the Presentation Tier

Thin client paradigm characterized by web applications is a kludge that needs to be repudiated. Old compromises are no longer needed and it's time to move the presentation tier to where it belongs.

Agile Project Management: Lessons Learned at Google

In this presentation filmed during QCon 2007, Jeff Sutherland, the creator of Scrum, talks about his visit at Google to do an analysis of Google's first implementation of Scrum.

AtomServer – The Power of Publishing for Data Distribution

In this article, Bryon Jacob and Chris Berry introduce AtomServer, their implementation of a full-fledged Atom Store based on Apache Abdera, which is now available as open source.

An Introduction to Virtualization

It is easy to think that virtualization applies only to servers. In reality the recent resurgence of the concept is also being applied to networking, storage, and application infrastructure.

REST Anti-Patterns

In this article, Stefan Tilkov explains some of the most common anti-patterns found in applications that claim to follow a "RESTful" design and suggests ways to avoid them.

Choosing between Routing and Orchestration in an ESB

In this article, Adrien Louis and Marc Dutoo discuss the differences and relative merits of using orchestration vs. routing in a typical ESB setup, and discuss various implementation options.

Enterprise Batch Processing with Spring

Wayne Lund discusses batch processing, Spring Batch objectives and features, scenarios for usage, Spring Batch architecture, scaling, example code, failures and retrying, and the future roadmap.

User Story Estimation Techniques

Developer Jay Fields draws on his experiences as a ThoughtWorks consultant to describe effective user story estimation techniques.