WCF Uncatched FaultException

Thread is closed for posting
3 posts, 1 answers
  1. Wolfgang
    Wolfgang avatar
    98 posts
    Member since:
    Oct 2012

    Posted 24 Oct 2012 Link to this post

    i'm trying to use a WCF Plain service in VS 2012 with .net 4.5.

    I tried the telerik developers manual.
    I created the service and a client.

    In the service interface IEntitiesModel I put [FaultContract(typeof(string))].
    In the EntitiesModel.SVC I used an easy construct as first try:

    throw new FaultException("test");

    In user code of Consumer i wrote a catch for the exception.
    Now the problem is:
    Every time the service is called, Visual Studio stops in throw new FaultException with the error message, that FaultException was not handled by usercode. If i continue with F5, the exception is also caught by usercode of consumer.

    Why does it stop in the service?

  2. Answer
    Viktor Zhivkov
    Viktor Zhivkov avatar
    324 posts

    Posted 24 Oct 2012 Link to this post

    Hi Wolfgang,

    I believe that you have enabled Break when Exception is Thrown option in Visual Studio Debug menu.
    Here is information how to enable it and you can use the same process to disable this behaviour.

    In general this should happen only when you are debugging with Visual Studio attached to the process.
    This is behaviour specific for Visual Studio and you can experience the same effect using any method that throws exception when this option is enabled.

    Hope that helps you avoid this inconvenience.

    All the best,
    Viktor Zhivkov
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  3. Wolfgang
    Wolfgang avatar
    98 posts
    Member since:
    Oct 2012

    Posted 25 Oct 2012 Link to this post

Back to Top