Using custom FaultContract object causes 'Add Service Reference' to fail
Posted
by
SpoBo
on Stack Overflow
See other posts from Stack Overflow
or by SpoBo
Published on 2011-01-11T09:49:17Z
Indexed on
2011/01/11
9:53 UTC
Read the original article
Hit count: 214
Hey,
I just noticed something particular. I have an internal stock service which is published through basicHttpBinding, and a customBinding (http+binary) for which metadata is enabled. I also included a mex endpoint for http. We use Visual Studio 2008 & VB.NET
Just recently we noticed that we were unable to succesfully add a service reference to this service in our other projects. All that it would generate was the first custom exception we included through a FaultContract (actually, there was only 1 type). if I'd add a simple web reference it would work correctly as well. Also, the WcfClient.exe had no problems either in loading the services. Just VS.NET add service reference wouldn't work.
In the service this exception inherits from Exception and is marked as serializable. That's all you're supposed to do, no?
Anyway, this had me baffled. If I remove the FaultContract for this custom exception everything works fine. I can add a service reference, no problem. But is there a way I can still have my custom exceptions? Is this a known problem? Thx!
© Stack Overflow or respective owner