Corruption of user.config

蹲街弑〆低调 提交于 2019-12-11 15:53:43

问题


Anyone knows the reason of "random" user.config corruption? I've a WinForms app affected by this problem at my client's production line. Found the same issue on the web and a workaround but I can't figure out because it happens.


回答1:


I'm not sure why it's happening, but you are not alone, dude! I also tried different things to get around this. I wrote my own configuration handling classes with custom serialization. All I can tell you is, it's better but now still there.

One observation I made recently is that the corruption seems to happen when the machine is rebooted (due to Windows Updates for example) while my app is running.

Next thing to try is to catch those shutdown events and try not to write to the config file in this situation.




回答2:


Did you try Properties.Setting.default.reset()?



来源:https://stackoverflow.com/questions/868653/corruption-of-user-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!