My library uses code contracts.
Is there a way to incorporate these contracts in the documentation generated by sandcastle?
My library uses code contracts.
Is there a way to incorporate these contracts in the documentation generated by sandcastle?
Edit: Turns out this method is outdated; just install Sandcastle Styles.
Sandcastle doesn't support it natively but Code Contracts comes with the required files.
First ensure you are generating documentation for your assembly, then in the Code Contracts settings for your project, set Contract Reference Assembly to 'Build', and check the box for "emit contracts into XML doc file".
Next, open C:\Program Files (x86)\Microsoft\Contracts\Sandcastle\Sandcastle.zip
(or just C:\Program Files\...
on a 32-bit installation - and the same for the instructions below).
What you have to extract depends on whether you installed Sandcastle with the MSI or from source (they're actually different versions):
msi\vs2005\
to C:\Program Files (x86)\Sandcastle\Presentation\vs2005\
, and overwrite any conflicts.source\vs2005\
to C:\Program Files (x86)\Sandcastle\Presentation\vs2005\
, and overwrite any conflicts.Finally, you need to create a new Sandcastle project. You can import your topics & settings from the old one in the wizard.
Then you should be able to run Sandcastle and have contracts in the documentation.