2017-06-07 12 views
0

私のWebConfigには、以下の接続文字列があります。私pub.pubxmlファイルでWebDeploy - 接続文字列TFS2017

<connectionStrings> 

    <add name="Name" connectionString="Url=hSomeURL; Domain=SomeDomain; Username=UserName; Password=YYYYY;" 

</connectionStrings> 

私はユーザー名、パスワード、およびドメインのための私のリリース定義からのEnv変数と、この文字列を変換しようとしています。 parameters.xmlファイルからこの接続文字列を呼び出すことができますか?これをWeb.Release.Configファイルに追加しようとしましたが、動作しませんでしたxdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>

答えて

1

parameters.xmlの自動生成された接続文字列名に一致するような正しい形式を使用していることを確認してください。サンプル:How to build a connection string from other parameters within MSDeploy packages to avoid repeating yourself in Release Management variables

:詳細については

<parameters> 
    <parameter name="Username" value="xxx"> 
    <parameterEntry type="XMLFile" scope="web.config$" match="//configuration/connectionStrings/site/@xxx"/> 
    </parameter> 

、あなたはこのブログを見てみることができ