Skip to main content

Cloud

HOW-TO: Get MSDN library links to SharePoint classes when generating documentation using Sandcastle

I’ve blogged before about using Sandcastle to generate HTML help files from embedded comments in .NET — and I still think it’s a great approach. One of the great features is the ability to display the inheritance hierarchy for your classes and any base classes or interfaces that they implement along with links to the standard .NET Framework classes on MSDN.

Here’s what that looks like in a test HTML help file that I created:

2008-06-20_075734

I’ve got a custom class that inherits from a winforms TextBox, and all the framework classes in my object’s hierarchy link to the relevant topic on MSDN online for those classes. Cool enough.

Now here’s a class that inherits from a SharePoint class:

2008-06-20_075844

Note that this time the classes in the hierarchy (and the base class) from the Microsoft.SharePoint namespace aren’t linked to MSDN. What’s up?

Turns out Sandcastle ships with a number of reflection files for the "core" of the .NET Framework — but of course SharePoint isn’t among them. The Sandcastle program folder contains a subdirectory at DataReflection that contains XML files for reflected classes for just this type of extensibility, and it has a utility called MRefBuilder.exe to reflect your own assemblies.

However, even after doing that, there are specific XSL transforms that you need to perform on the XML that the MRefBuilder utility kicks out. (This forum post helped me out on this.)

In any case, my experience was that it was something less than intuitive to get this working, so I figured I’d offer up the reflected and transformed XML from Microsoft.SharePoint.dll.

  • Download the XML here (3 MB)

All you will need to is put this file in the DataReflection folder of your Sandcastle install, and your compiled help files should now show the links to the MSDN library for SharePoint classes, as well. Like this:

2008-06-20_080653

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Matthew Morse

More from this Author

Follow Us