none
Smoke but no gun: IO exception in mscorlib but program isn't running - WTH? RRS feed

  • Question

  • I'm stumped.

    I have a python script that is launching several instances of a .net EXE I've written in C#.  I've run this app a zillion times from the command line and never gotten an exception.

    But now that I'm launching it via  script, I'm occasionally getting the "...Program has stopped working" dialog. When I look at the details in that dialog box, I see "mscorlib" and "IO exception", among other data I don't recognize.

    Here's the goofy part. Without answering this dialog box, I run task manager and see that the app is not even running. Also, if I hit "debug" on the dialog box, nothing happens (the dialog goes away without attempting to start a debugger).

    I think what this means is that the program has already exited at that point.

    If this is true, does this mean that exception was thrown while the application was trying to exit, and how am I supposed to figure out the problem in that case?   One possible clue: the application is using a background thread worker - could that be the source of the IO error somehow?

    Any ideas of how to debug this would be extremely appreciated!

    Thanks

    Michael

    Friday, May 11, 2012 4:15 PM

Answers

  • Hi Michael,

    Welcome to the MSDN Forum.

    This may be caused by permission. Since you said, when you run it directly, it is fine, but when you run it in a script, it got a IO exception.

    Actually, many factors can cause IO exception, and the permission is one of them.

    As Jared said, do you get any .net stack trace?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 14, 2012 10:23 AM
    Moderator

All replies

  • Is there a .Net error event in the Application Event Log? Those usually will have stack traces.

    Friday, May 11, 2012 8:45 PM
  • Hi Michael,

    Welcome to the MSDN Forum.

    This may be caused by permission. Since you said, when you run it directly, it is fine, but when you run it in a script, it got a IO exception.

    Actually, many factors can cause IO exception, and the permission is one of them.

    As Jared said, do you get any .net stack trace?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 14, 2012 10:23 AM
    Moderator