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

  • Home
  • SEARCH
  • 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 7163135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:51:03+00:00 2026-05-28T13:51:03+00:00

I use WCF for an ASP.Net MVC 2 Application. And when the service has

  • 0

I use WCF for an ASP.Net MVC 2 Application.
And when the service has a fault I need to keep restarting both server and client.
The channel is faulted is the error.

Why is that happening? Why do I get this error and what do you recommend me to avoid the habit of restarting, due to the fact that is time consuming.

edit1:
I use using block to host a service.
I will provide a little program with sample code to reproduce the problem soon.

edit 2:
I use a self hosted WCF Service Library

[ServiceContract]  
public interface IAuctionService  
{  
    [OperationContract]  
    [FaultContract(typeof(DatabaseFault))]  
    void SaveCategory(CategoryDTO category);  

    [OperationContract]  
    [FaultContract(typeof(DatabaseFault))]  
    List<CategoryDTO> ListCategories();  

    [OperationContract]  
    [FaultContract(typeof(DatabaseFault))]  
    CategoryDTO GetCategoryById(long id);  
}

And in the client I have added a Service References to this service.

Should I handle all type of exceptions and throw them using faults to client?

  • 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-28T13:51:05+00:00Added an answer on May 28, 2026 at 1:51 pm

    You should not wrap ServiceHost in a using block!

    See here for details:
    http://www.danrigsby.com/blog/index.php/2008/02/26/dont-wrap-wcf-service-hosts-or-clients-in-a-using-statement/

    UPDATE

    Regarding sending faults to your callers: Yes generally speaking you should return exceptions on the service as SOAP faults to the caller. This is what the SOAP fault was designed for.

    However, you should define a fault contract for every type of fault you want to return the caller.

    As guideline you should only send faults which the caller can handle meaningfully and recover from (either by retry or some other action).

    If you have a fault on the service where the channel to your caller has aborted then you don’t need to explicitly send faults, WCF will do this for you.

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

Sidebar

Related Questions

So I'm doing a project. MS SQL->WCF->Client (win32 application + asp.net MVC 3 web)
I have a project consisting of three projects, WCF service Asp.net MVC 3 application
I have an ASP.NET MVC 3 application that uses a WCF service within the
I want to consume a JSON/ WCF service in asp.net MVC 3 application. Do
I use WCF with my ASP.NET MVC app, my data service get data from
I use ASP.NET and WCF services in a load balanced web server environment, using
I need to host a WCF Data service as part of a legacy ASP.NET
I have an ASP.NET MVC web app whose controllers use WCF to call into
Does ASP.NET MVC and WCF Web API use the same routing module for routing
I want to use my current application done in Asp.net MVC 3 on mobile

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.