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 6376967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:48:39+00:00 2026-05-25T01:48:39+00:00

I heard that it’s essential to Dispose (or Close) a WCF client proxy even

  • 0

I heard that it’s essential to Dispose (or Close) a WCF client proxy even when

  • you’re not using sessions
  • there are no unmanaged resources that need deterministic clean up (e.g. open sockets)

For example, when using a BasicHttpBinding with the default binding configuration, this should be fine even in a popular web page, right?

var clt = new MyServiceClient();
clt.PlaceOrder(foo);
// no dispose

or

var clt = new ChannelFactory<IOrderService>().CreateChannel();
clt.PlaceOrder(foo);

Thanks

  • 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-25T01:48:39+00:00Added an answer on May 25, 2026 at 1:48 am

    Creating a ChannelFactory & Opening it is an expensive operation and you should avoid doing it for every call if you care performance.

    Your first usecase is not right even with basicHttpBinding because it will potentially create a new channelfactory for each instantation. .NET 3.5 SP1 has introduced some ChannelFactory caching so you might be ok in certain scenarios.

    In your 2nd usecase, if you cache and reuse the channelfactory, disposing isn’t really nesseaary but keep in mind you/your deployment guy can change the binding @ deployment time and lack of closing/disposing can have a huge impact.

    In summary it’s always safe to close/dispose and that’s why MSDN suggest that.

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

Sidebar

Related Questions

I heard that C# does not free memory right away even if you are
I heard that there is a mechanism to deliver ad-hoc version app for client
I heard that you could right-shift a number by .5 instead of using Math.floor().
I heard that using short s on 32bit system is just more inefficient than
I heard that WPF is more suitable than WinForms for working with WCF. Is
I heard that there is a keyboard short cut to bring up the code
I heard that many of the blog sites are using this protocol. I want
I heard that SQL Injection can still be possible when using ADO.NET SQLParameter (paramterised
I heard that you can compile .ss files with DrScheme, and even remember doing
I heard that there are four patterns in asynchronous execution. There are four patterns

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.