1
我的Web.config:變換的Web.config Hibernate配置VS 2012
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/>
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="connection.connection_string">{old_connection}</property>
<property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
<property name="proxyfactory.factory_class">NHibernate.Bytecode.DefaultProxyFactoryFactory, NHibernate</property>
<property name="show_sql">false</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
</session-factory>
</hibernate-configuration>
</configuration>
我申請的轉換。 Web.Release.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"
xmlns:hib="urn:nhibernate-configuration-2.2">
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/>
</configSections>
<hib:hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<hib:session-factory>
<hib:property xdt:Transform="Replace" xdt:Locator="Match(name)" name="connection.connection_string">{new_connection}</hib:property>
</hib:session-factory>
</hib:hibernate-configuration>
</configuration>
在Release中運行VS2012,轉換不會發生。該字符串未被替換。 可能是什麼原因?
web.config沒有改變,命名空間沒有問題。但是你在這篇出版物中正在發生轉變。當我剛剛發佈時,它工作。 – ask125342