?
Solved

"ConfigurationErrorsException" from "Settings.Default.Save()" in C# winform

Posted on 2013-12-18
4
Medium Priority
?
645 Views
Last Modified: 2013-12-19
Hi experts
I got an exception "ConfigurationErrorsException" when my program executed the statement "Settings.Default.Save()".

The details of the exception is: "Failed to save settings: An error occurred loading a configuration file: Could not find a part of the path 'C:\Users\dwong\AppData\Local\....'"

What puzzles me is that:
1. this problem happens only after I'd changed to a new hard disk (Windows 7, 32-bit).
2. this problem happens only when I run the program from the VS2008 debugger (release/debug modes).
3. this problem does *not* occur when the program is run normally (ie., after installing the program into the PC and run it directly)

Would it be a permission or security issue?

Thanks in advance.
0
Comment
Question by:dominicwong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39729609
Are you running Visual Studio as Administrator on Windows 7?
0
 

Author Comment

by:dominicwong
ID: 39730587
Thanks TheLearnedOne.
I'd checked "User Accounts" under the "Control Panel". In the 'Group' column, mine is 'Administrators'.
But how do I tell whether I am running VS as Administrator? Please enlighten.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 39730871
When you run Visual Studio as administrator, by right-clicking on the link in the Start menu, or changing the startup for the link to Run as Administrator, the window title will include the text [Administrator].

When you are running Windows 7 with UAC enabled, your privileges are not administrator level, until you formally request it.
0
 

Author Closing Comment

by:dominicwong
ID: 39731009
Thanks TheLearnedOne.

That solves my problem! I'd been running VS on Windows XP, and I didn't know there is such an option in Windows 7. Thanks again.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question