Sort of empty user.config files? RRS feed

  • Question

  • We've been having an issue with two of our software packages where, if the software crashes for some reason, the user.config files where the options are saved to are left empty.

    Well, sort of empty.

    They actually contain characters, but they're all the null character (when you look at it in a hex editor, its all zeroes). It seems to have some length, possibly the proper length, but no actual characters.

    One interesting thing is that in one application, we're just using the default settings provider. In the other application, we're actually using a custom one so that we could control the location of the settings. Both applications experience this issue.

    When the software starts back up after that file is written incorrectly, it crashes immediately. Deleting the file will cause it to be recreated from the default settings as expected.

    Any thoughts on what might be going on here?
    Thursday, March 5, 2009 3:57 PM


  • Anything can happen when a program crashes.  The usual problem is not crashing quick enough.  Look at your source code and remove try/catch statements that shouldn't be there.  Especially catch(Exception).
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Wednesday, March 11, 2009 8:54 AM
    Friday, March 6, 2009 1:21 AM