How do I Document Fault Contracts?

May 4, 2009 at 3:42 PM
Edited May 4, 2009 at 3:43 PM
I'm documenting a service interface that looks like:

interface IMyService{

   int DoSomething(int i, int j);


since Sandcastle isn't WCF-aware, I need to document the operation's faults from a .NET perspective.  This means that the operation can throw a FaultException<InvalidInputFault> (which derived from exception) or a FaultException<MyBusinessRuleFault>

I've tried:


<exception cref="System.ServiceModel.FaultException{InvalidInputFault}">Means something bad happened</exception>



And I've tried

/// <exception cref="System.ServiceModel.FaultException<InvalidInputFault>">Means something bad happened</exception>




But neither have worked.  Any Ideas??

May 4, 2009 at 7:17 PM
Edited May 4, 2009 at 7:19 PM
Using a specific concrete type for a generic isn't supported in a cref target since it's something the compiler creates.  Use "FaultException{T}" instead so that it can link to the base generic type.  You can note the specific type name in the inner text if necessary.  For example:

/// <exception cref="System.ServiceModel.FaultException{T}">When the type is
/// <see cref="InvalidInputFault" />, something bad happened.</exception>

May 4, 2009 at 8:06 PM
Looks Good.  I'll go with that.