vb.netvisual-studiovisual-studio-2015

visual studio: How to Read Settings in Visual Basic


I right-clicked the project name and added new item called "Application settings". At beginning, its name is "Settings1.settings", I changed to Settings.settings. Below is the screenshot: enter image description here

I tried to read the settings in my form. But there is an error. enter image description here

My questions: 1, Why I can not read the values in Settings.settings by "My.Settings.test"?

Any help is welcome.


Solution

  • By default, visual basic should have already created a settings file which should be located at My Project > Properties > Settings

    Unless you need more settings files, there shouldn't be any need to create any settings files manually.