I'm trying to change in runtime one key of my applications settings file, but it does not work.
I do on that way:
ConfigurationSettings.AppSettings["XPTO"] = "HELLO";
It seems that it only changes in memory, not on the file.
Does anyone knows how to do this?
Thanks.
From the Home screen, tap the Apps icon (in the QuickTap Bar) > the Apps tab (if necessary) > Settings .
Settings. settings is located in the My Project folder for Visual Basic projects and in the Properties folder for Visual C# projects. The Project Designer then searches for other settings files in the project's root folder. Therefore, you should put your custom settings file there.
Application settings enables developers to save state in their application using very little custom code, and is a replacement for dynamic properties in previous versions of the . NET Framework.
To check your settings: Go to Solution Explorer > expand the Properties node of your project > double-click the . settings file. There you can create your own settings with User scope and edit it at runtime, if that is your intention.
Take a look at my overview of .NET settings files...In short, I think you want a user-scoped setting. It will behave more like you expect.
Edit: If you are using the settings designer in Visual Studio, then simply change the "Scope" to "User". If not, you should be able to do the equivalent programmatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With