WCF validation adaptor: The creator of this fault did not specify a Reason

Topics: Validation Application Block
Apr 17, 2007 at 9:53 AM

I've configured the validation block using attributes on a simple wcf contract - I know the validation is happening from my unit tests but I just get a simple FaultException returned without any validation information in the detail type

I have the FaultContract(typeof(ValidationFault)) on my operation plus teh other attributes as per the docs

where should I start to look for the reason the detail type is not getting sent?

Apr 17, 2007 at 8:02 PM
Hi Richard -

The Detail property of the FaultException should contain the useful information.

Apr 18, 2007 at 7:25 AM
Thanks for the reply Tom,

I resolved it by adding the behavior config to teh web.config for the endpoint (along with the behvior extension stuff indicated in the docs) - I wasn't sure that I needed to do this as the docs seem to imply the ValidationBehavior attribute on the interface should be enough - is that the case? - ie you can use all attributes without config elements?

Apr 18, 2007 at 4:10 PM
You can do it using just attributes, but not just validation attributes. You also need a ValidationBehaviorAttribute on your service contract.