Всем привет!
Пробую пример из MSDN в консольном приложении на .NET 4.0
Вот такие строчки:
var configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// Create the section group entry in the <configSections> and the related target section in <configuration>.
if (configuration.SectionGroups["CustomGroup"] == null)
{
var customSectionGroup = new CustomSectionGroup();
configuration.SectionGroups.Add("CustomGroup", customSectionGroup);
customSectionGroup.ForceDeclaration(true);
configuration.Save(ConfigurationSaveMode.Full);
}
Нужный Файл появляется, все что нужно добавляется в него, но это пока приложение работает. После закрытия приложения файла нет.
В чем тут дело?