locked
Suppressing Unhandled Exceptions of External Applications RRS feed

  • Question

  • I have a .NET 2.0 app which has one module responsible for media file conversion to an ogm format (the open source one). There is an os app for that called ffmpeg2theora and it is a command line application.
    I use Diagnostics.Process to launch it and I read all it's output. The problem, however is that it crashes on Vista when at 99% in the conversion process. The output file working, but the users see this nasty application has stopped working error.

    Is it possible to suppress or catch this unhandled exception?


    Thanks
    Tuesday, April 8, 2008 6:40 AM

Answers

  • it's not the .NET app that's crashing, but the process I am executing.
    Then you should contact the provider of the process you're executing.
    Wednesday, April 9, 2008 9:10 AM

All replies

  • Could you please cover the exception in more details? You can post its stack trace, and inner exception here.

    To troubleshoot this issue, we really need the source code and the detailed repro steps to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logic from it.

    Wednesday, April 9, 2008 2:00 AM
  • Ok, so the process executing code code is as follows:

     

     

    Code Snippet

    Public Sub BeginConversionAsync(ByVal file2convert As String, ByVal ExpectedOutput As String)

    p = New System.Diagnostics.Process

    p.StartInfo.UseShellExecute = False

    p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden

    p.StartInfo.RedirectStandardOutput = True

    p.StartInfo.RedirectStandardError = True

    p.StartInfo.CreateNoWindow = True

    p.StartInfo.FileName = My.Settings.ffmpeg2theora_path

    p.StartInfo.Arguments = String.Format(" {0} -a 8 -v 8 -o {1}", """" & file2convert & """", _

    """" & ExpectedOutput & """")

    p.Start()

    p.BeginOutputReadLine()

    p.BeginErrorReadLine()

    Dim th As New Threading.Thread(AddressOf Me.ProcessChecker)

    th.IsBackground = True

    th.Name = "Conversion process checker"

    th.Start()

    RaiseEvent OGGConversionStarted()

    End Sub

     

     

    I use ffmpeg2theora version 0.20. On XP SP2 it exits normally, on Vista business 32 bit it crashes upon exit. Are there any kind of parameters to set to the process when starting to suppress any errors?

    About the stack trace I cannot give this, because it's not the .NET app that's crashing, but the process I am executing. It shows the standard windows message like "Process has stopped working...windows is trying to find a solution"...or something like this.

    Wednesday, April 9, 2008 4:20 AM
  • it's not the .NET app that's crashing, but the process I am executing.
    Then you should contact the provider of the process you're executing.
    Wednesday, April 9, 2008 9:10 AM
  • Ok, so there is absolutely no way I could intercept and suppress this? Ok, guess I am going to have to email the people, who have compiled the binary then.

    Thanks for your replies.
    Wednesday, April 9, 2008 1:24 PM