Q:

.NET 'Settings' not working on 64-bit (InvalidOperationException)

I am building a C# .NET (VS2010) application but am having some trouble saving settings, (which work fine under 32bit Windows XP), under 64bit Windows 7.
I have a Settings.settings in the solution, with a settings test value named res112text in, set as type string at user scope, with 'Internal' as the access modifier setting.
Then the save command in
Properties.Settings.Default.res112text = "10002b";
try
{
   Properties.Settings.Default.Save();
}
catch (Exception e)
{
   MessageBox.Show(e.GetType().ToString() + " for " + e.Message.ToString());
}

when caught instantly brings up the error type:
System.InvalidOperationException

and for the exception message it says:
Method failed with unexpected error code 3
I am packing the .dll.config file in the setup installer and it installs into the Program Files directory fine. 
Can anyone suggest what might be going wrong please?
Update: The full error is..
Error System.InvalidOperationException: Method failed with unexpected error 
code 3. 

at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(
ResourceType resourceType, Boolean isContainer, String name, SafeHandle 
handle, AccessControlSections includeSections, Boolean createByName, 
ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)

at System.Security.AccessControl.FileSecurity..ctor(String fileName, 
AccessControlSections includeSections)

...

at System.Configuration.SettingsBase.Save()

at MyAddon.IEModule.ConfigSave()

Update: It appears there isn't a workaround when IE's Protected Mode is enabled, unless all users switch it off manually.

A:

Your problem is probably caused because of insufficient rights to save the file. Like Hans Passant suggested, you should take a look at Isolated storage: http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragefile.aspx
The purpose of isolated storage is to allow applications with limited rights to save data. The MSDN page contains a code sample that should get you up-and-running.

