我是web.config轉換的新手,但它使用我的連接字符串。但是,我的轉換爲自定義節(nhibernate)沒有被應用。這裏的轉換文件:web.config轉換不適用於特殊部分
<?xml version="1.0"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="ApplicationServices"
connectionString="Data Source=.\SQLEXPRESS;Database=msmri_Users;UID=myuser;pwd=mypass;"
providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<appSettings>
<add key="TableStorageEndpoint" value="http://127.0.0.1:10002/devstoreaccount1" xdt:Transform="Remove" xdt:Locator="Match(key)" />
</appSettings>
...
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.connection_string" xdt:Transform="Replace" xdt:Locator="Match(name)">
Data Source=.\SQLEXPRESS;Database=mydb;UID=myuser;pwd=mypass;
</property>
</session-factory>
</hibernate-configuration>
</configuration>
感謝所有的想法。謝謝!
this(https://connect.microsoft.com/VisualStudio/feedback/details/558441/web-config-xdt-should-support-custom-config-sections?wa=wsignin1.0)表明這不是支持,這將是嚴重跛腳 – sydneyos 2010-11-03 21:19:41