Saving config file - System.UnauthorizedAccessException



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
.



Relevant Pages

  • Re: Surely someone has come across this problem before........
    ... running the configuration wizard again (probably will get you past this ... Event Type: Error ... see Help and Support Center at ... connectionString, SqlFile sqlFileId, String sqlSignaturePath, ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Surely someone has come across this problem before........
    ... Technologies Configuration Wizard ... I've unsuccessfully run the Sharepoint Products and Technologies ... see Help and Support Center at ... connectionString, SqlFile sqlFileId, String sqlSignaturePath, ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Surely someone has come across this problem before........
    ... Technologies Configuration Wizard ... I've unsuccessfully run the Sharepoint Products and Technologies ... see Help and Support Center at ... connectionString, SqlFile sqlFileId, String sqlSignaturePath, ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Surely someone has come across this problem before........
    ... running the configuration wizard again (probably will get you past this ... Event Type: Error ... see Help and Support Center at ... connectionString, SqlFile sqlFileId, String sqlSignaturePath, ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Surely someone has come across this problem before........
    ... running the configuration wizard again (probably will get you past this ... Event Type: Error ... see Help and Support Center at ... connectionString, SqlFile sqlFileId, String sqlSignaturePath, ...
    (microsoft.public.sharepoint.windowsservices)