XML-Document-Transform を使用して、web.config ファイルをステージング サーバーへの展開用に変換しています。残念ながら、指定どおりに変換されておらず、要素のテキストに空白が追加されています。この空白は、私が使用しているキャッスル ウィンザー構成によって取得され、アプリケーションを爆撃します。
次に例を示します。
web.config:
<configuration>
<castle>
<properties>
<serverUrl>http://test</serverUrl>
<properties>
<components>
<component id="MyService">
<parameters>
<Url>#{serverUrl}/MyService.asmx</Url>
</parameters>
</component>
</components>
<castle>
<configuration>
web.staging.config:
<configuration>
<castle>
<properties>
<serverUrl xdt:Transform="Replace">http://staging</serverUrl>
<properties>
<castle>
<configuration>
出力 web.config:
<configuration>
<castle>
<properties>
<serverUrl>http://staging
</serverUrl>
<properties>
<components>
<component id="MyService">
<parameters>
<Url>#{serverUrl}/MyService.asmx</Url>
</parameters>
</component>
</components>
<castle>
<configuration>
ご覧のとおりserverUrl
、変換によって追加の空白が要素に挿入されています。
残念ながら、サービスの に を挿入すると Castle に空白が含まれserverUrl
、Url
無効な URL が作成されます。
他の誰かがこれに出くわしますか?Microsoft の新しい変換方法を引き続き使用しているが、追加の空白が挿入されないソリューションを得た人はいますか?
IMHO これは変換プロセスのバグですが、Castle はおそらく空白も無視する必要があります。
どうもありがとう、ロブ