configuration.Save(ConfigurationSaveMode.Modified, true)
和configuration.Save()
有什麼區別?System.Configuration:關於Configuration.Save方法的提問
背景:我有一個程序,我在那裏操縱web.config
,我使用配置WCF服務。我將它加載到一個Configuration
對象中,更改一些屬性並將其保存。當我使用configuration.Save(ConfigurationSaveMode.Modified, true)
我得到一個Exception
這樣的:
「這是使用註冊爲allowDefinition =應用程序級別之外‘MachineToApplication’的節是錯誤的......」
當我使用configuration.Save()
,然後有用!究其原因,例外可能是部分<serviceActivations>
在我的web.config(異常點,本節)