I am using the Web publishing tool from Visual Studio 2012 to publish to File System. I learned that I can open my *.pubxml in the Properties folder to do more advanced things.
What I want to do is run a command line application at the end of the publishing task. I would usually do it in a Custom Target and execute it after one of the build in Events like this.
<Target Name="CustomAfterPublish" AfterTargets="GatherAllFilesToPublish">
</Target>
The problem is that GatherAllFilesToPublish
is way to early because I want to execute it at the very last, after publishing was done.
Is there a list or does someone know the build in events and there order in which they are fired? Basically the Event Lifecycle of a FileSystem web publish.
Or how can I fire a Target manually at the very end?
I tried following without success:
<Target Name="Msg" AfterTargets="PipelineDeployPhase;MSDeployPublish;Package">
And also every each of them individually. So what's the very last hook of the publishing lifecycle?
---> Edited
I added already tracing. The problem is that the files were copied to a temp path and after that all files are deleted. So copying to the destination will not work after "GatherAllFilesToPublish"
See my trace from the command line window here...
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 ==========
Thanks for any help.