posted on Friday, November 26, 2004 8:58 AM
by
thomasswilliams
Warning: Don't Write to app.config in Windows Forms
Hmmm, looks like I'm in trouble as two of my Windows Forms apps write to the app.config file (in fact I've got a whole class just to simplify doing this), and I've just found out it's not a good idea.
IanG (via the Daily Grind) has written a pretty concise summary of why I shouldn't be doing this. One of the downsides to writing to the config file that Ian highlights is that users typically don't have permission to write to the same folder as the executable (under the Program Files folder), and he is spot on - standard users in our organisation aren't even allowed to shut down the computer (the only option under Start > Shut Down... is “Log Off“).
Ian recommends the user's profile directory, so it's back to the drawing board for me...