如何使用 nant 从 nhibernate.config 文件更改连接字符串
问题是所有示例都是关于更改属性值,但 nhibernate 有内部文本
情商:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.connection_string">Data Source.\server;Database=UnitTestDb;UID=user;pwd=pass;</property>
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="show_sql">true</property>
<property name="connection.release_mode">auto</property>
<property name="adonet.batch_size">500</property>
....
我需要更改属性 connection.connection_string
<xmlpoke file="${nhibernate.file}"
xpath="/hibernate-configuration/session-factory/add[@key='connection.connection_string']/@value"
value="${connection.string}">
</xmlpoke>
这在这种情况下不起作用。
谢谢