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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:19:35+00:00 2026-05-13T09:19:35+00:00

I have code below that is getting called from a while loop so it’s

  • 0

I have code below that is getting called from a while loop so it’s executing multiple times in a row. Sometimes, but not always, I end up getting a thread was being aborted error on the p.WaitforExit(). Does anyone have any insight into this? should I be calling p.Close() after p.WaitForExit?

string outputFileName = Path.Combine(Path.GetDirectoryName(recordingFileName), Guid.NewGuid() + ".mpg");
        ProcessStartInfo startInfo = new ProcessStartInfo(ffmpegfileName);
        startInfo.Arguments = "-i \"" + recordingFileName + "\" -r 30 -sameq \"" + outputFileName + "\"";
        startInfo.WindowStyle = ProcessWindowStyle.Hidden;
        Process p = Process.Start(startInfo);
        p.WaitForExit();
        if (p.ExitCode != 0)
        {
            throw new Exception("exited with an exit code of " + p.ExitCode.ToString(CultureInfo.InvariantCulture) + ".");
        }
        return outputFileName;
Thread was being aborted.
mscorlib
 at System.Threading.WaitHandle.WaitOneNative(SafeWaitHandle waitHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
 at System.Threading.WaitHandle.WaitOne(Int64 timeout, Boolean exitContext)
 at System.Diagnostics.Process.WaitForExit(Int32 milliseconds)
 at System.Diagnostics.Process.WaitForExit()
  • 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-13T09:19:35+00:00Added an answer on May 13, 2026 at 9:19 am

    If you are calling it from an ASP.NET page the Exception you are seeing is most likely a result of you hitting the Execution timeout on the Request for the page and it is being aborted. The error is on the p.WaitforExit() line because that is where your ASP.NET page was while it was waiting for the Process you started to return. You can change the default execution timeout (110 seconds in 2.0) in the web config file for your ASP.NET app.

    <httpRuntime  executionTimeout = "600" >
    

    or via code in the page for that page only:

      HttpContext.Current.Server.ScriptTimeout
    

    http://msdn.microsoft.com/en-us/library/e1f13641.aspx

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

Sidebar

Ask A Question

Stats

  • Questions 508k
  • Answers 508k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Ok, turns out the project was a Flex 3 project… May 16, 2026 at 4:18 pm
  • Editorial Team
    Editorial Team added an answer First, the type attribute is not allowed on the video… May 16, 2026 at 4:18 pm
  • Editorial Team
    Editorial Team added an answer Some hosts may offer both PHP4 and PHP5 environments and… May 16, 2026 at 4:18 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a bit of code below that creates a button on a html
I'm currently calling Trace (method below) from a game loop. Right now all I'm
Why might SCardEstablishContext hang, never to return, when called from a service? I have
In the example code below, I have a question about the List. My prof
Ok I have some code that boils down to a pattern like this class
Hi the problem goes like this: I have in CoreData entities that have a
I have two threads in a producer-consumer pattern. Code works, but then the consumer
Anyone have any idea how to get the SACL's on a remote service using
So I have a ViewController Class which is my first view, I then add
I am creating a script on the fly to ftp some files from a

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.