We help IT Professionals succeed at work.

vb.net Configuration, settings file location?

Jess31
Jess31 asked
on
2,007 Views
Last Modified: 2017-03-19
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.
Comment
Watch Question

Fernando SotoRetired
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
It should in the same location the application exe fille is located.
CERTIFIED EXPERT

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

Commented:
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

Author

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

Author

Commented:
arana,
This properties shows me where it puts it on my computer, and does not allow me to change it.
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2015

Commented:
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).

Author

Commented:
I have scoped both ways with same results.
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions