I have a couple of appSettings in my app.config file, with default values:
<appSettings>
<add key="Foo" value="one"/>
<add key="Bar" value="two"/>
</appSettings>
which I am able to read and put the values into a TextBox and a ComboBox
I have this code to save the changes made to those two, but the changes I make are not saved to the app.config file itself, so when I close the program and open it again, the values go back to the defaults.
Private Sub ButtonSaveSettings_Click(sender As Object, e As EventArgs) Handles ButtonSaveSettings.Click
Dim settings = System.Configuration.ConfigurationManager.AppSettings
settings.Set("Foo", TextBoxFoo.Text)
settings.Set("Bar", ComboBoxBar.SelectedItem.ToString)
End Sub
What do I need to do to get the updated values to persist to the app.config file?
(edit: The answers on the duplicate were not for VB and didn't solve this issue.)