Click here to Skip to main content
13,191,400 members (77,135 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked
Posted 9 Sep 2006

SandCastle documentation cleaner.

, 9 Sep 2006
Rate this:
Please Sign up or sign in to vote.
Cleans the "extra" documented text out of your SandCastle built documentation.


 It all started when I found out that the documentation generated by SandCastle was showing internal code (those members marked as 'internal' and 'internal protected'). Of course this was unwanted. So with my magic regular expression wand and an observant eye, I created some regex that would "clean" the comments. Then I went a step further and had it clean the MS stuff out also.

I present to you the culminated version.

These are just the regular expressions used to match the xml that contains the unwanted code (multi-line mode should be used):
(\s*)<element api=\"F:(.*)/> (cleans any internal members)
(\s*)<element api(.*)System.Web.UI(.*)/> (cleans MS doc stuff)
(\s*)<element api=(.*)(EXTRA_STUFF_HERE)(.*)/> (takes any extra)

The CastleCleaner is designed to parse and remove all traces of members marked as internal, comments from the System.Web.UI namespace, and extra stuff you type into the "Remove" field.
The remove field uses the pipe ( | ) delimited case-sensitive text to "clean" any other code with that member name.
FYI: The output is written to the input file.

The only way that I have implemented the CastleCleaner has been via a 'PAUSE' after the MRefBuilder generates its output file. During the pause I find the generated MRegBuilder file and drop it into the CastleCleaner window. And in about two seconds (depending on the input) it rewrites the freshly baked and cleaned file.
So that is what I recommend you do.

Batch File Example:
cd "c:\project\bin\Debug"
MRefBuilder "C:\project\bin\Debug\project.dll" /

Remove Field Example:

License / Warranty:
License: Use it as you see fit, but please give credit to me (C. Bess).
Warranty: Be realistic... Its free for all.

Side Notes:
The CastleCleaner (when used as directed) makes the documentation a lot more "personal" and it actually speeds up the generation (of course).


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

C. Bess
Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171017.1 | Last Updated 9 Sep 2006
Article Copyright 2006 by C. Bess
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid