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.
It does work with Sandcastle though there are some tweaks necessary to integrate them fully. Refer to section 8.3 in the Code Contracts User Manual dated 2/4/2011 (or later) available at http://research.microsoft.com/en-us/projects/contracts/userdoc.pdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With