14

ケース (デバッグ、リリースなど) ごとに異なる構成ファイルを作成しようとしていますが、ビルドごとにいくつかの設定を変更したいと考えています。

<configuration>
<applicationSettings>
<Program1.Properties.Settings>
  <setting name="CustomerId" serializeAs="String">
    <value>Custormer1-13256</value>
  </setting>
</Program1.Properties.Settings>
</applicationSettings>
</configuration>

タグ内の値を別のものに変更するにはどうすればよいですか?

   ex. <value>Customer2-343242</value>
4

5 に答える 5

3

これは機能します:

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <applicationSettings>
        <Program1.Properties.Settings>
            <setting name="CustomerId" serializeAs="String" xdt:Locator="Match(name)" >
                <value xdt:Transform="Replace">Customer2-343242</value>
            </setting>
        </Program1.Properties.Settings>
    </applicationSettings>
</configuration>
于 2015-09-22T14:29:53.367 に答える
0

Web.Config XML のフル パスに変換を配置する必要があります。

<applicationSettings>
  <Program1.Properties.Settings>
    <setting name="CustomerId">
      <value xdt:Transform="Replace">Customer2-343242</value>
    </setting>
  </Program1.Properties.Settings>
</applicationSettings>

次に、Preview Transform メニュー オプションを使用してテストします。

于 2013-04-24T12:35:12.720 に答える