Process.Start throws exception when starting firefox after firefox crashes

Discussion in 'Microsoft Dot NET Framework' started by Gene Chang, Oct 23, 2007.

  1. Gene Chang

    Gene Chang Guest

    I have an application that starts the default browser by using
    Process.Start(URL). The one time that I get a file not found
    exception is when Firefox has crashed and comes up with the "Firefox -
    Restore Previous Session" screen.

    It does seem to start up but for some reason an exception is thrown
    because the browser hasn't started.

    Does anyone know why I get the exception in this case? I don't want
    to just eat the exception because the thing I start isn't necessarily
    a URL. It could be any format that may not have a default
    application. In that case, I want to notify the user that there isn't
    anything to handle it.

    Thanks.

    Gene Chang
     
    Gene Chang, Oct 23, 2007
    #1
    1. Advertisements

  2. Gene Chang

    cokkiy Guest

    Maybe the url is in bad format.
    "Gene Chang" <> ????
    news:...
    >I have an application that starts the default browser by using
    > Process.Start(URL). The one time that I get a file not found
    > exception is when Firefox has crashed and comes up with the "Firefox -
    > Restore Previous Session" screen.
    >
    > It does seem to start up but for some reason an exception is thrown
    > because the browser hasn't started.
    >
    > Does anyone know why I get the exception in this case? I don't want
    > to just eat the exception because the thing I start isn't necessarily
    > a URL. It could be any format that may not have a default
    > application. In that case, I want to notify the user that there isn't
    > anything to handle it.
    >
    > Thanks.
    >
    > Gene Chang
     
    cokkiy, Oct 24, 2007
    #2
    1. Advertisements

  3. Gene Chang

    Gene Guest

    Nope. The URL format is fine. It looks like it might be a known
    Firefox issue. I get the file not found error, but Firefox still
    opens properly with the correct page. What I'm going to do is to
    detect if firefox is the default http application. If it is and the
    error is 2 (file not found), then I'm going to eat the exception. Not
    sure if there is any other way...

    Thanks.

    Gene

    On Oct 24, 11:44 am, "cokkiy" <> wrote:
    > Maybe the url is in bad format.
    > "Gene Chang" <> ????news:...
    >
    > >I have an application that starts the default browser by using
    > > Process.Start(URL). The one time that I get a file not found
    > > exception is when Firefox has crashed and comes up with the "Firefox -
    > > Restore Previous Session" screen.

    >
    > > It does seem to start up but for some reason an exception is thrown
    > > because the browser hasn't started.

    >
    > > Does anyone know why I get the exception in this case? I don't want
    > > to just eat the exception because the thing I start isn't necessarily
    > > a URL. It could be any format that may not have a default
    > > application. In that case, I want to notify the user that there isn't
    > > anything to handle it.

    >
    > > Thanks.

    >
    > > Gene Chang
     
    Gene, Oct 25, 2007
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page