4

We have quite a large site now, build in C#/Asp.Net. We've got two publishing profiles, one for Staging and one for Production. They have been made using standard Web Deploy publish profiles.

What we now want to do is to send out an email any time we publish to Production. What I would like to do is find some sort of post publish method that I can hook into. Sort of like the Post-build event, except for publishing instead.

Is this possible?

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
user1166145
  • 193
  • 3
  • 10
  • Can you confirm if you're using Visual Studio Websites, or an ASP.NET Web Application project? – Dai Mar 24 '13 at 23:43
  • It's an ASP.Net Web Application – user1166145 Mar 24 '13 at 23:45
  • Yes, publishing is regular target (similar to build) - so you can extend it the same way you make any custom MSBuild changes. The only special thing about post/pre build steps they are exposed via VS IDE. – Alexei Levenkov Mar 25 '13 at 00:42
  • I am sorry but I am not quite sure on how I do this. Would it be possible to point me in the right direction? An references would be highly appreciated since my google searches so far have been futile. Many thanks – user1166145 Mar 25 '13 at 02:30

1 Answers1

5

Although I haven't tested it out there is some direction here

Real simple example:

<Target Name="BeforePublish" BeforeTargets="MSDeployPublish">
  <Exec Command="D:\Pre.bat" />
</Target>
<Target Name="AfterPublish" AfterTargets="MSDeployPublish">
  <Exec Command="D:\Post.bat" />
</Target>
Community
  • 1
  • 1
Carl Clark
  • 291
  • 4
  • 13