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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:29:12+00:00 2026-05-25T17:29:12+00:00

I have a host that has a method which pops up a MessageBox the

  • 0

I have a host that has a method which pops up a MessageBox

the client just activate the function.

it is working but something is weird :

  ChannelFactory<IMessagingService> channel = new ChannelFactory<IMessagingService>("NetTcpBinding_IMessagingService");

                 IMessagingService proxy = channel.CreateChannel();
                 proxy.Hello("Royi");

if i click on the button in the client many times i see several meesage box ( without closing the last one !!!!!)

enter image description here

but if i change the client code to : ( just by the using mechanism)

 ChannelFactory<IMessagingService> channel = null;

            using (channel= new ChannelFactory<IMessagingService>("NetTcpBinding_IMessagingService"))
             {
                 IMessagingService proxy = channel.CreateChannel();
                 proxy.Hello("Royi");
             }

and if i try to press many times on the client button – it WONT ALLOW ME !!

enter image description here

this is the code at the host which generates the popup

   [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerCall)]
    public class MessagingService : IMessagingService
    {

        public void Hello(string message)
        {
            MessageBox.Show(message);
        }


    }

i want to understand why

thank you.

  • 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-25T17:29:12+00:00Added an answer on May 25, 2026 at 5:29 pm

    First gues (without knowing what the channelfactory does):
    Using will call the dispose method after proxy.Hello. The first example uses multiple ChannelFactories next to eachother (till the GC destroys them), while the 2nd always destroyes the ChannelFactory after you print Hello.

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

Sidebar

Related Questions

i have a domain full-ops.com that i transferred to another host, but it takes
HELP! I just setup a virtual host for two sites that have a lot
Here's the scenario: I'd like to have a host class that can have a
I have a rails app that I'm going to host on engineyard and want
I have a ChildUserControl that is loaded inside a ParentUserControl. The host page loads
I have a WinForms user control Host with a custom UI Editor. Through that
.Net 3.5, using C# I have an instance of a class (A) that has
I currently have a C# project which uses plugins and has a fairly common
I have a form on which I use validation. This form has a section
I have a large directory which I need to upload to a new host's

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.