Is there any way to call custom code when publishing?

前端 未结 1 2050
孤独总比滥情好
孤独总比滥情好 2021-01-06 05:41

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 Dep

相关标签:
1条回答
  • 2021-01-06 06:30

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

    • Post Publish Events
    • http://msdn.microsoft.com/en-us/library/ms366724.aspx
    • http://msdn.microsoft.com/en-us/library/7z253716.aspx (MSBuild Tasks)
    • http://msdn.microsoft.com/en-us/library/t9883dzc.aspx (Create a custom MSBuild Task(

    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>
    
    0 讨论(0)
提交回复
热议问题