views:

134

answers:

2

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.

A: 

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.

Stefan Koell
A: 

Hi Guys,

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