【发布时间】:2016-08-26 12:01:03
【问题描述】:
我想在发布完成后执行脚本。要在 Visual Studio 中开始发布,我右键单击 project -> Publish... 对于发布,我使用 FTP 方法。 我知道我可以在 .xproj 或 .pubxml 文件中设置目标,但我找不到将调用我的目标的实际事件。 我的 .pubxml 文件是这样的:
<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。我到处寻找,但找不到方法。
【问题讨论】:
标签: visual-studio msbuild publishing