开发者

How is my user.config Settings file getting corrupted?

开发者 https://www.devze.com 2023-04-07 02:56 出处:网络
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'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 go开发者_开发知识库tten 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 ConfigurationErrorsExceptions.

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号