C# .NET 2.0 Windows 응용 프로그램을 사용하고 있습니다.AppSettings 변경 내 응용 프로그램을 다시 시작해야합니다 어떻게 피할 수 있습니까?
그리고 내 응용 프로그램 설정에 app.config를 사용하고 있습니다.
그러나 AppSettings의 변경 내용은 런타임을 반영하지 않으므로 응용 프로그램을 다시 시작해야합니다.
어떻게 피할 수 있습니까?
다음은 응용 프로그램 설정을 읽고 쓰는 데 사용한 코드 단편입니다.
나는이
string temp = ConfigurationManager.AppSettings.Get(key);
내가 노드 당신은 새로
ConfigurationManager.RefreshSection("appSettings")
를 호출 시도 할 수 있었다 현재 구성/appSettings는 노드
node.Attributes["value"].Value = value;
xmlDoc.Save(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
+1 매우 멋진 - 당신이 할 수 있는지 몰랐습니다! –
RefreshSection이 작동하지 않습니다. –
작업 중 !!! – shahjapan