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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:31:07+00:00 2026-05-11T16:31:07+00:00

I am aware of this other post , but it doesn’t seem to apply

  • 0

I am aware of this other post, but it doesn’t seem to apply to my situation.

First off, here is my environment:
Windows XP 64-bit SP3; Visual Studio 2008 w/ SP; .NET 3.5 SP1; WPF application.

My problem is that I cannot seem to step to where my exception happens. It just keeps running instead of continuing the debugging session.

Here is some code — I didn’t write all of it, so please, no need for comments on naming 🙂

// start up the WPF application
// set the handler for the Checked event
ToggleButton channelButton1 = new ToggleButton();
channelButton1.Checked += (s, e) => 
     ThreadPool.QueueUserWorkItem(SetTcpChannel, 1);

Then in that SetTcpChannel method:

    try
    {
        int channel = (int)state;
        EnsureTcpSocket();
        // more logic to do stuff with channel 
        // that we don't care about for SO
        ...
    }
    catch (Exception e)
    {
        // just for illustration
        // this is where I expected the code to return
        ...
    }

And finally, in the place where the exception actually happens (inside EnsureTcpSocket):

    if (_tcp == null)
    {
        // this is not a valid ip/port since the 
        // target machine is not running (test condition)
        // but that's ok, I should get some exception 
        // and continue debugging...right?
        _tcp = new TcpClient(ip, port);
    }

Here is what I have been doing:

  1. I set a breakpoint at the
    EnsureTcpSocket line inside
    SetTcpChannel,
  2. F11 (step-into) EnsureTcpSocket
    so I can see the _tcp piece of
    code
  3. Try to F10 (step-over) the
    TcpClient constructor

At that last step, the application comes back up from the debugger and keeps running and I never see any exception.

Any ideas?

  • 1 1 Answer
  • 2 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-11T16:31:08+00:00Added an answer on May 11, 2026 at 4:31 pm

    How long did you wait? Depending on exactly what the arguments are, the TcpClient constructor may wait until it times out before throwing the exception. (If the connection is refused, that’s a different matter.)

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

Sidebar

Related Questions

First off, I'm aware this is a bad practice and I have answered many
My project doesn't seem to be aware of this new constant that's apparently auto-generated
I hope itll be legal to post this as i'm aware of other similar
At first, this might not seem the proper place to ask this... But since
I aware that this will be a less programming question, but still... How can
I'm aware that this is possible with the os module's os.system(color) function, but this
I'm aware of using syntax like this: (something) ? TRUE : FALSE But what
Although it is looking similar to my previous post but here purpose is different.
I've checked for other questions relevant to this, but the only answer is Use
I apologize if this is a duplicate post, but I couldn't find the answer

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.