- I am using Code Contracts ver: 1.4.40602.0
- I copied the necessary Content and Transforms files
- Sandcastle throws exceptions based on my contract requirements.
Code example:
public class MyClass { public MyClass(Object obj) { Contract.Requires<ArgumentNullException>(obj != null); } }
Result (in my documentation):
| Exception | Condition | |---------------------------------|---------------------------------| | System.ArgumentNullException | obj == null |
It is not that bad, however I am wondering if there is a way to customize the condition text? I tried adding a message to the user Contract.Requires<ArgumentNullException>(obj != null, "obj is null.");
However, this did not solve anything.
In the past, I had to write my own xml documentation section for exceptions. Do I have to do this again to get what I need?
Disclaimer: since Code Contracts (currently) is a DevLabs project, this may change, but I wonder if it is already available right now ... if not, I will definitely offer it.
my
source share