Saving config file - System.UnauthorizedAccessException
- From: David++ <David@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 11 Sep 2006 06:04:01 -0700
An new day, a new problem.
This time I am attempting to save settings back to the application
configuration file. The exe and config file reside on a network drive. I've
configured the application to be trusted fully using the Microsoft
Configuration Tool and the security errors I was getting before disappeared.
Now when I go to save any settings to the config I get this error -
System.UnauthorizedAccessException: Attempted to perform an unauthorized
operation.
at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type,
String name, SafeHandle handle, SecurityInfos securityInformation,
SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl,
GenericAcl dacl)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String
name, SafeHandle handle, AccessControlSections includeSections, Object
exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String
name, AccessControlSections includeSections)
at System.Security.AccessControl.FileSystemSecurity.Persist(String
fullPath)
at System.IO.File.SetAccessControl(String path, FileSecurity fileSecurity)
at
System.Configuration.Internal.WriteFileContext.DuplicateTemplateAttributes(String source, String destination)
at
System.Configuration.Internal.WriteFileContext.DuplicateFileAttributes(String
source, String destination)
at System.Configuration.Internal.WriteFileContext.Complete(String
filename, Boolean success)
at
System.Configuration.Internal.InternalConfigHost.StaticWriteCompleted(String
streamName, Boolean success, Object writeContext, Boolean assertPermissions)
at
System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.WriteCompleted(String
streamName, Boolean success, Object writeContext, Boolean assertPermissions)
at
System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.WriteCompleted(String
streamName, Boolean success, Object writeContext)
at
System.Configuration.Internal.DelegatingConfigHost.WriteCompleted(String
streamName, Boolean success, Object writeContext)
at System.Configuration.UpdateConfigHost.WriteCompleted(String
streamName, Boolean success, Object writeContext)
at System.Configuration.MgmtConfigurationRecord.SaveAs(String filename,
ConfigurationSaveMode saveMode, Boolean forceUpdateAll)
at System.Configuration.Configuration.SaveAsImpl(String filename,
ConfigurationSaveMode saveMode, Boolean forceSaveAll)
at System.Configuration.Configuration.Save(ConfigurationSaveMode saveMode)
at PricingLoader.Maintenance.UpdateSettings(String input, String output,
String error, String backup, String interval)
at PricingLoader.Maintenance.BtnOk_Click(Object sender, EventArgs e)
Any ideas how I can resolve this problem?
Thankyou once again....
David
.
- Prev by Date: System.UnauthorizedAccessException - Using win forms application opening file - Urgent
- Next by Date: Re: System.UnauthorizedAccessException - Using win forms application opening file - Urgent
- Previous by thread: System.UnauthorizedAccessException - Using win forms application opening file - Urgent
- Next by thread: Re: Saving config file - System.UnauthorizedAccessException
- Index(es):
Relevant Pages
|