I'm trying to change the value of the App.config file and it doesn't save anything, I don't get any errors when saving, and when I run the program again it still has the same value.
var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
var settings = configFile.AppSettings.Settings;
Console.WriteLine(settings["id_shops"].Value = "50");
configFile.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection(configFile.AppSettings.SectionInformation.Name);
The problem is that the file you are modifying is the one in the bin/Debug folder. It is normal that it does not save the changes because when compiling, it replaces this file with the original and overwrites it.
To solve this, you only have to make the changes in the original file, located in the root of the project and when compiling you will see that the changes have been saved.