簡體   English   中英

App.config修改在退出后還原

[英]App.config modifications revert after exit

我正在修改MyApp.vhost.exe,並且正如我在文本編輯器中看到的那樣修改了App.vhost.exe,但是當我停止調試應用程序時,App.config值恢復為更改前的狀態。 。 我做錯了什么或我想念什么?

Configuration exeConfiguration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
var section = exeConfiguration.GetSection(monitorSectionElementName);

if (section != null)
{
    var monitorPathElements = (section as MonitorSection).MonitorPaths;
    monitorPathElements[monitorPath].CheckSum = checkSum;
}

exeConfiguration.Save(ConfigurationSaveMode.Full, true);
ConfigurationManager.RefreshSection(monitorSectionElementName);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM