How corrupted user.config settings file?

I had a user who sent me a crash report from a call to Settings.Upgrade() :

 System.Configuration.ConfigurationErrorsException: Root element is missing.

I made him send me my user.config file, and the file was all zeros. It somehow got corrupted.

I found a way to restore it by running the% localappdata% \ MyAppName directory and deleting all user configuration files and restarting the application. If I allow the application to continue execution, it will give another ConfigurationErrorsException s.

Could this damage be the result of something I did? I had several reports about this from a database of several thousand users, but I did not bother with this file directly. Does anyone else encounter this user.config error?

+8
settings wpf
source share
2 answers

Just the idea I got from this article.

Can you check the version of the .Net framework, and if so, have you recently made an update that could change any methods you use?

Another, although it was an article (it is a bit old - 2008), but it gives some guidance on how to handle a damaged configuration file.

Could this be a memory problem caused by the fact that the application cannot copy the user's current speed?

I hope this helps, because it is not with me, but it’s an interesting and mysterious dilemma.

+4
source share

Settings seem to be corrupted when running multiple instances of your application. This seems to be a synchronization issue, but a relatively simple way to reproduce is to start the application itself, and then exit and try to save the settings on exit.

+1
source share

All Articles