TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Frank Du
NA
1
0
writing to a config file
Jan 6 2008 6:58 PM
Hello,
I copied this code from MS web site trying to add a new key to current config file, but it does not save the config file at all when my app exits, any idea?
// Open App.Config of executable
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings.Add("TestKey", "gdhgasdkjadhsj");
// Save the configuration file.
config.Save(ConfigurationSaveMode.Full);
How could this code have no exceptions whatsoever but just not doing what Microsoft claim it should do -- save the damn config file?
Reply
Answers (
1
)
Problems with an Indexer using a class as the type.
edit and delete