无法在64位操作系统中更新ASP.net中的配置文件,但在32位下工作正常

时间:2014-03-04 06:17:21

标签: c# windows-applications

我有一个Windows服务,它不断读取配置文件。 UI是表单应用程序,它更新配置文件。它适用于32位系统。在64位的情况下,当我尝试更新配置文件时,它显示以下错误。在我的日志文件中,它显示以下异常。

System.Configuration.ConfigurationErrorsException: Unable to save config to file 'C:\Program Files\Essel SWolutions\AutomatedBackUpSetUp2\AutomatedBackUp_Form 1.0.0.exe.Config'.
   at System.Configuration.Internal.WriteFileContext.ReplaceFile(String Source, String Target)
   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 AutomatedBackUp_Form_1._0._0.configuration.configure(String sourcePathValue, String destinationPathValue, Boolean zipValue, Boolean encryptValue, Boolean mailValue, String frequency, String hour, String minute, String ampm, String time, String sendersid, String recieversid, Boolean txtCheck, Boolean jpgCheck, Boolean zipCheck, Boolean xmlCheck)
   at AutomatedBackUp_Form_1._0._0.ConfigurationForm.updateButton_Click_2(Object sender, EventArgs e)

1 个答案:

答案 0 :(得分:1)

我认为64位机器的路径类似于C:\Program Files (x86)\..