3
(我的問題是類似this one,但代碼略有不同,該解決方案不爲我工作)ConfigurationManager中不保存設置exe.config
我想保存設置的更改到app.config
:
Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
config.AppSettings.Settings("HistoryRootDirectoryPath").Value = p_historySavingPath
config.Save(ConfigurationSaveMode.Modified)
ConfigurationManager.RefreshSection("appSettings")
沒有被保存既不到exe.config
文件中的bin文件夾,而不是實際的app.config
文件。我究竟做錯了什麼?
您是否收到任何錯誤?例外?你看過`Debug`和`Release`文件夾嗎? – Oded 2011-12-15 11:13:16