我正在使用流利的 NHibernate。
我有一个带有几个特定键(applicationSettings 和 userSettings)的 app.config 文件。
似乎 nhibernate 不喜欢这些键。只要文件中存在这些键,Fluently.Configure() 就会失败,并抛出带有 Unrecognized configuration section applicationSettings 消息的异常。
我能做些什么?
这是配置文件:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="MyDB" connectionString="Data Source=|DataDirectory|\MyDB.sdf" providerName="Microsoft.SqlServerCe.Client.3.5" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<applicationSettings>
<MyApp.Properties.Settings>
<setting name="ServerIp" serializeAs="String">
<value>127.0.0.1</value>
</setting>
<setting name="ServerPort" serializeAs="String">
<value>5678</value>
</setting>
<setting name="UseSSL" serializeAs="String">
<value>True</value>
</setting>
<setting name="WsUrl" serializeAs="String">
<value/>
</setting>
</MyApp.Properties.Settings>
</applicationSettings>
<userSettings>
<MyApp.Properties.Settings>
<setting name="User" serializeAs="String">
<value>test</value>
</setting>
<setting name="Password" serializeAs="String">
<value>test</value>
</setting>
</MyApp.Properties.Settings>
</userSettings>
</configuration>
谢谢!