Solved

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

Posted on 2013-12-18
4
625 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
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

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

Author Comment

by:dominicwong
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now