我正在修改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);