C# 类库项目中的.NET设置文件

C# 类库项目中的.NET设置文件,c#,wpf,application-settings,C#,Wpf,Application Settings,我想在外部dll库中使用.NET设置文件。准确地解释了我要做的事情 partial class LastState { public LastState() : base(new ConfigurationFileApplicationSettings("LastState.config", typeof(LastState))) { } } 遗憾的是,使用此实现无法将设置保存回配置文件。如果尝试使用Save(),SetPropertyValues会抛出NotSupportedExce

我想在外部dll库中使用.NET设置文件。准确地解释了我要做的事情

partial class LastState
{
    public LastState() : base(new ConfigurationFileApplicationSettings("LastState.config", typeof(LastState))) { }
}
遗憾的是,使用此实现无法将设置保存回配置文件。如果尝试使用
Save()
,SetPropertyValues会抛出NotSupportedException。有没有办法从外部dll库保存.NET设置文件?

我会使用

看看更多的détails

你可以省钱

config.AppSettings.Settings["YourThing"].Value = "New Value";
config.Save(); 
config.AppSettings.Settings["YourThing"].Value = "New Value";
config.Save();