2016-08-26 17 views
0

公開終了後にスクリプトを実行します。 Visual Studioで公開を開始するには、プロジェクト - >公開...を公開するには、のFTPメソッドを使用します。 私はターゲットを.xprojまたは.pubxmlファイルに設定できますが、ターゲットを呼び出す実際のイベントは見つかりません。 このような私の.pubxmlファイルLOK:VisualStudioで公開後にアクションを実行

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <WebPublishMethod>FTP</WebPublishMethod> 
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> 
    <LastUsedPlatform>Any CPU</LastUsedPlatform> 
    <SiteUrlToLaunchAfterPublish>htttp://example.com</SiteUrlToLaunchAfterPublish> 
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> 
    <ExcludeApp_Data>False</ExcludeApp_Data> 
    <PublishFramework>netcoreapp1.0</PublishFramework> 
    <UsePowerShell>False</UsePowerShell> 
    <publishUrl>ftp://example</publishUrl> 
    <DeleteExistingFiles>False</DeleteExistingFiles> 
    <FtpPassiveMode>False</FtpPassiveMode> 
    <FtpSitePath>myFolder</FtpSitePath> 
    <UserName>john</UserName> 
    <_SavePWD>False</_SavePWD> 
    </PropertyGroup> 
    <Target Name="MyTarget"> 
    <Message Text="Hello..." /> 
    </Target> 
</Project> 

私は、ターゲットMyTargetを呼びたいです。私はどこにでも見ましたが、私はこれを行う方法を見つけることができません。

答えて

2

FTPメソッド(VS2015)を使用して公開するWebアプリケーションの詳細ログ(診断)に基づいて、最後のターゲットはGatherAllFilesToPublishで、FTPのフォルダーにファイルを公開する前に実行されています。

GatherAllFilesToPublishの後にターゲットで他のものを試してみてください。たとえば(プロジェクトファイルXXX.csprojを編集する):

<Target Name="CustomPostPublishActions" AfterTargets="GatherAllFilesToPublish"> 
<Message Text="This is custom target" Importance="high" /> 


</Target> 
関連する問題