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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:23:53+00:00 2026-05-16T08:23:53+00:00

Our application has a background thread which spawns a process through System.Diagnostics.Process : Process.Start(

  • 0

Our application has a background thread which spawns a process through System.Diagnostics.Process:

Process.Start(
    new ProcessStartInfo
    {
        FileName = url,
        UseShellExecute = true
    }
);

This used to have no issues at all. But now, the background thread is silently dying; it never returns from the call to Process.Start. The catch block for this code, which handles System.Exception, is not getting reached either. Even if I enable handling exceptions when thrown in the Visual Studio debugger, I see no exceptions. Strangely, the process is getting spawned just fine; the default browser for the user is launched with the expected URL.

Our process’s entry point is marked with [STAThread] as recommended.

What could be causing our thread to silently terminate? Are there any techniques I can use to debug what’s happening during thread termination?

Update:

It looks like the thread is alive after all; it’s just not returning from the call. Here’s its stack trace:

  • [In a sleep wait or join]
  • System.dll!System.Diagnostics.ShellExecuteHelper.ShellExecuteOnSTAThread() + 0x63 bytes
  • System.dll!System.Diagnostics.Process.StartWithShellExecuteEx(System.Diagnostics.ProcessStartInfo startInfo) + 0x19d bytes
  • System.dll!System.Diagnostics.Process.Start() + 0x39 bytes
  • System.dll!System.Diagnostics.Process.Start(System.Diagnostics.ProcessStartInfo startInfo) + 0x32 bytes
  • My method

Update 2:

Launching cmd.exe without using the shell to execute works as a workaround. Thanks a bunch! However, I’d still like to know why the call isn’t returning.

Update 3:

Shell hooks do sound like a logical explanation for what could be causing the call to not return. I couldn’t find the rogue module, but after the last attempt to run things through shell execution, the call did return.

In any case, it’s possible that users may have shell extensions loaded that could be messing with the process launching and causing my code to not return. We can’t do anything about that, so the right answer is to use the workaround of launching a cmd.exe process.

  • 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-16T08:23:54+00:00Added an answer on May 16, 2026 at 8:23 am

    As mentioned by Hans Passant, a hanging Process.Start call might be the reason. When using Process.Start with UseShellExecute set to true, the Windows API function ShellExecuteEx is called under the hood which might not return under certain circumstances.

    You can check whether this is the case by adding trace messages to your code:

    System.Diagnostics.Trace.WriteLine("About to start process.");
    Process.Start(
       new ProcessStartInfo
       {
           FileName = url,
           UseShellExecute = true
       }
    );
    System.Diagnostics.Trace.WriteLine("Process started.");
    

    To listen to the trace messages you can either use a TraceListener, check the output window of Visual Studio or use a tool such as DebugView.

    As a workaround you may use the start command. The following code launches a hidden shell window which “starts” the url:

    Process.Start(
        new ProcessStartInfo()
        {
            FileName = "cmd.exe",
            Arguments = "/c start http://www.google.com",
            WindowStyle = ProcessWindowStyle.Hidden,
            UseShellExecute = false
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently going through the process of running FxCop through our application that has
In our application through the process of developing a lot of JAR files has
Our Java application has a number of modules which implement a common interface. By
Our application has a table which stores all transactions records of clients in one
Our application has a service layer and a DAO layer, written as Spring beans.
Our application has many controls that are created dynamically. For example, a navigation pane
Our application has a couple of shell scripts that are called from web-based Oracle
I have a Windows application. The windows application has our XML Library on it.
Our large application (VB.Net, Framework 3.5) has been developed more or less from the
My company has a ClickOnce application that has been in use with our customers

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.