0

接続文字列とアプリの設定を暗号化したいと考えています。現在、複数の公開プロファイルがあり、各プロファイルには変換があります。

Below is my pubxml file code but for some reason my target with exec command is not getting triggered. Can some one familiar with the subject matter please help!! 

前もって感謝します。

<project toolsversion="4.0" xmlns="http://schemas.microsoft.co...">
    <propertygroup>
    <webpublishmethod>FileSystem</webpublishmethod>
    <lastusedbuildconfiguration>Release</lastusedbuildconfiguration>
    <lastusedplatform>Any CPU</lastusedplatform>
    <siteurltolaunchafterpublish/>
    <launchsiteafterpublish>True</launchsiteafterpublish>
    <excludeapp_data>False</excludeapp_data>
    <publishurl>e:\Test_Deployment</publishurl>
    <deleteexistingfiles>False</deleteexistingfiles>
    <msdeployenablewebconfigencryptrule>true</msdeployenablewebconfigencryptrule>

    </propertygroup>
    <target name="CustomPostPublishActions" aftertargets="MSDeployPublish">
    <exec command="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pe appSettings -app $(publishUrl)/MyProj"/>
    <exec command="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef connectionStrings $(publishUrl) -prov MyProviderKey"/>
    </target>

    </project>
4

1 に答える 1

0

それが機能しない場合は、次の手順を試すことができます。

1- 新しいビルド構成を作成します ([デバッグ/リリース] メニューで[構成マネージャー] に移動し、[構成] 列で新しい構成を作成します)。

2- ビルド後のイベント ([プロジェクト プロパティ] > [ビルド イベント] > [ビルド イベント後のコマンド ライン]) で、次のようなものを追加します。

if "$(ConfigurationName)" == "MyNewBuildConfiguration"(
execute commands in here
)

3- このビルド構成を使用するためにプロファイルを更新します。

お役に立てれば。

于 2017-11-28T18:32:41.133 に答える