我们开始使用nhibernate并设置会话管理器来创建新的SessionFactory。我需要在应用程序第一次启动时修改一些信息。具有名称空间的Xml元素
我使用XDocument打开配置文件(不是app.config)。
<settings>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<reflection-optimizer use="false"/>
<session-factory>
<property name="x">SomeValue</property>
</session-factory>
</hibernate-configuration>
</settings>
XDocument xdoc = XDocument.Load(<file>);
var x = xdoc.Root.Element("hibernate-configuration");
x是空的,除非我删除xmlns。我错过了什么?