我正在使用 Visual Studio 2012 中的 Web 发布工具发布到文件系统。我了解到我可以在 Properties 文件夹中打开我的 *.pubxml 来做更高级的事情。
我想要做的是在发布任务结束时运行命令行应用程序。我通常会在自定义目标中执行它,并在这样的事件中构建之一之后执行它。
<Target Name="CustomAfterPublish" AfterTargets="GatherAllFilesToPublish">
</Target>
问题是这GatherAllFilesToPublish
太早了,因为我想在发布完成后最后执行它。是否有一个列表或者是否有人知道内置事件以及它们被触发的顺序?基本上是文件系统网络发布的事件生命周期。
或者我如何在最后手动触发目标?
我尝试了以下但没有成功:
<Target Name="Msg" AfterTargets="PipelineDeployPhase;MSDeployPublish;Package">
而且每个人都是单独的。那么发布生命周期的最后一个钩子是什么?
---> 已编辑我已经添加了跟踪。问题是文件被复制到临时路径,然后所有文件都被删除。"GatherAllFilesToPublish"
因此,在此处从命令行窗口查看我的跟踪后,复制到目标将不起作用...
1>------ Build started: Project: Dependency of a project: Release Any CPU ------
2>------ Build started: Project: Dependency of another project, Configuration: Release Any CPU ------
3>------ Build started: Project: Web, Configuration: Release Any CPU ------
4>------ Publish started: Project: Web, Configuration: Release Any CPU ------
4>Transformed Web.config using C:\...\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
4>Copying all files to temporary location below for package/publish:
4>obj\Release\Package\PackageTmp.
**<------------- Here is the place where my excutable is called ---------------------------------**
4>Deleting existing files...
4>Publishing folder /...
4>Publishing folder App_Browsers...
4>Publishing folder App_Themes...
4>Publishing folder bin...
4>Site was published successfully file:///C:/Test
4>
========== Build: 3 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
谢谢你的帮助。