I've had a user send me in a crash report from a call to Settings.Upgrade()
:
System.Configuration.ConfigurationErrorsException: Root element is missing.
I got him to send me his user.config file and the file was all zeroes. It had gotten corrupt somehow.
I found a way to recover from it by rooting around the %localappdata%\MyAppName directory and deleting all user config files and re-launching the app. If I let the app continue execution it would give further ConfigurationErrorsException
s.
Could this corruption be the result of something I've done? I've had multiple reports of it from a base of a few thousand users, but I have not been messing with that file directly. Has anyone else run into this user.config corruption?
In computing, configuration files (commonly known simply as config files) are files used to configure the parameters and initial settings for some computer programs. They are used for user applications, server processes and operating system settings.
The path to that file is %appdata%\%publisher_name%\%program_name%\%version%\user. config , e.g. C:\Users\My Name\AppData\Local\My_Company\My_Program.exe\1.0. 0\user. config .
Your computer may be trying to use the wrong program to open the CONFIG file, or it may not have a program installed that can open the file. There are a few different programs you can use to open CONFIG files, including Unknown Apple II File, CRiSP Harvest File, and WatchDirectory Task Information software.
Just an idea I got from this article.
Can you check your .Net framework version and if so, did you did some update recently that might have altered any methods that you are using ?
Another though was this article (it's a bit old - 2008) but it gives some pointers on how to handle the corrupted config file.
Can it also be a memory issue caused by the application not being able to cop with the current user rate?
Hope it helps since it has not happened to me yet but still an interesting and puzzling dilemma.
Settings seem to get corrupted if running multiple instances of your application. It seems to be a timing issue, but a relatively easy way to reproduce is to have the application launch itself and then quit, and try to save settings on exit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With