Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7616899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:00:17+00:00 2026-05-31T03:00:17+00:00

When throwing a FaultException<CustomFault> like this: throw new FaultException<CustomFault>(new CustomFault(Custom fault message)); I get

  • 0

When throwing a FaultException<CustomFault> like this:

throw new FaultException<CustomFault>(new CustomFault("Custom fault message"));

I get the following: “The creator of this fault did not specify a Reason.”
Now according to this MSDN article one isn’t required to use the FaultReason

I have the following Service Contract:

[OperationContract]
[FaultContract(typeof(CustomFault))]
CustomType[] SomeMethod(int someParameter);

[DataContract]
public class CustomFault
{
    private string report;

    public CustomFault(string message)
    {
        this.report = message;
    }

    [DataMember]
    public string Message
    {
        get { return this.report; }
        set { this.report = value; }
    }
}

There is a comment on the MSDN article that suggest it is mandatory to use the other FaultReason, but in several other places I have seen people arguing that you shouldn’t use the FaultReason unless necessary.

So my question is as follows; is it really mandatory to use the FaultReason and if not – how can i prevent the exception raised when trying to throw a FaultException?

EDIT

By running the sample project from this article I get the excact same behavior. Maybe it’s caused by an update in .NET an the documentation/samples not being updated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:00:19+00:00Added an answer on May 31, 2026 at 3:00 am

    The fault reason is required while the details are optional.

    WCF uses the value of the FaultException.Reason property to populate the <faultstring> element of the SOAP Fault, which is required by the SOAP specification:

    faultstring
    The faultstring element is intended to provide a human readable explanation of the fault and is not intended for algorithmic
    processing. […] It MUST be present in a SOAP Fault element and
    SHOULD provide at least some information explaining the nature of the
    fault.

    Hence, you must provide a reason for the fault when throwing a FaultException from a WCF service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code is throwing the error this.element is null. However, the wid_cont is
Throwing exceptions often follows the following pattern: if(condition) { throw exception; } you check
The below is throwing the following error: Warning: mysql_fetch_array(): supplied argument is not a
Throwing ActiveRecord::Rollback works, but not in tests. I've had this problem before, am now
Instead of throwing new Exception(Some message, maybeSomeCause) , which means that all callers of
My designer keeps throwing out the term liquid layout. What does this mean? Thanks
First shot at throwing a question on these boards so hopefully I can get
My application is throwing a Security Exception with the following details: Description: The application
Why is this code throwing up a SIGSEGV : int main() { unsigned long
the source is throwing the error: 'nn.asdf' does not contain a definition for 'extension_testmethod'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.