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

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.
dominicwongAsked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
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
 
Bob LearnedCommented:
Are you running Visual Studio as Administrator on Windows 7?
0
 
dominicwongAuthor Commented:
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
 
dominicwongAuthor Commented:
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
All Courses

From novice to tech pro — start learning today.