vb.netsettings.settings

How to save to vb.Net .Settings file?


I'm able to pull values from settings in my .settings file, but unable to write to them.

Here's what I've tried:

My.Settings.Item(SettingsName) = Me.SettingProperty1

error message:

SettingsPropertyNotFoundException was unhandled
The settings property 'property1Value' was not found.    

enter image description here


Solution

  • I do this in my FormClosing event handler...

    My.Settings.YourSettingName = YourValue
    

    Edit: This might not be what you're asking for.

    If you're just wanting to save the settings:

     My.Settings.Save()