Avatar of Jess31
Jess31
 asked on

vb.net Configuration, settings file location?

I have a vb.net winforms application. I compiled and published it. Then I copied publish folder to another computer. It runs fine.
But I would like change settings in the configuration file. How can I do this? Where can I find location of the Configuration file. I am referring to settings one can create and put in properties (right click on project), settings tab.
Visual Basic.NET

Avatar of undefined
Last Comment
Ark

8/22/2022 - Mon
Fernando Soto

It should in the same location the application exe fille is located.
Arana (G.P.)

from the .net ide you can find it here:
config file
Ark

Add reference to System.Configuration
Dim config = System.Configuration.ConfigurationManager.
  OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.PerUserRoamingAndLocal)
MessageBox.Show(config.FilePath)

Open in new window

Change UserLevel as you need. See this article for more details
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Jess31

ASKER
Ark,
I get msg ConfigurationManager is not a member of System.Configuration and ConfigurationUserLevel is not a member of System.Configuration
Jess31

ASKER
arana,
This properties shows me where it puts it on my computer, and does not allow me to change it.
kaufmed

How are the settings scoped? Application-scoped settings will be in the config file the others have mentioned; user-scoped settings will be in a config file found under the current user's profile folder (i.e. AppData).
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Jess31

ASKER
I have scoped both ways with same results.
ASKER CERTIFIED SOLUTION
Ark

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question