update app.config file programmatically with ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

后端 未结 2 1272
心在旅途
心在旅途 2020-12-01 11:21

update app.config file programmatically with

Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

2条回答
  •  醉话见心
    2020-12-01 11:56

    The ProjectBase.Data.OpenSessionInViewSection indicates that there is already a custom config section defined that will allow access to the config settings. It may, however be protected or internal to NHibernate.

    See if you can reference that class to access the settings.

    You could also create a custom configuration section yourself, however it would cause NHibernate to be improperly configured since it would not be able to load the config section properly.

    see How to: Create Custom Configuration Sections Using ConfigurationSection

提交回复
热议问题