8

Looking for some help from anyone that's worked with SlowCheetah to transform config files under a web project. We're finding that partial config files referenced from the web.config are not being transformed.

For example, we've included references to partial configs AppSettings.config and ConnectionsString.config in the web.config like so:

  </system.web>
  <connectionStrings configSource ="ConnectionsString.config"></connectionStrings>
  <appSettings configSource ="AppSettings.config"></appSettings>
</configuration>

and then in the AppSettings.config we have just the AppSettings section like so:

<appSettings>
  <add key="LostPasswordBCC" value="knock@timmons.com" />
</appSettings>

and finally in the transform file AppSettings.Debug.config we have some additions:

<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations 
     see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <appSettings >
    <add key="Release" value="Something" xdt:Transform="Insert" />
  </appSettings>
</configuration>

Obviously the above is just a test to see the transform occur, but what we're finding is that on attempting to preview the transform all we get back is an error "There was an error processing the transformation." The publish attempt also fails.

If we make the config files fully formed xml and not referenced from web.config, the transformation seems to work fine - but were looking to share these files across multiple projects.

Does anyone know if there's a workaround where we can both reference partial configs from the web.config and also have transforms off those partial files? We're dealing with legacy code with a large number of config files across multiple web projects that were attempting to consolidate, thus the need to link from web config to separate shared files.

4

1 に答える 1

4

問題は解決されました。Sayed の助けを借りて、Web プロジェクトでの構成変換プロセスを理解するための努力の中で、変換構成ファイルの形式が破損していたことが判明しました。新しく作成された構成ファイルを使用して、SlowCheetah を使用して変換を機能させることができました。

これにより、Visual Studio 2012 のパブリッシュ プロファイルを使用して web.config 以外のプロジェクト構成を変換する必要があるという実際の問題に取り組むことができました。これは最初は機能しませんでしたが、Sayed が私たちを助けてくれて、これを機能させる新しい SlowCheetah のコピーを提供してくれました。

以下は、修正された新しいバージョンの SlowCheetah へのリンクです: https://github.com/sayedihashimi/slow-cheetah/issues/46

すべてのあなたの時間と忍耐に感謝します。

于 2012-11-15T15:43:20.647 に答える