שבת 14 אפריל 2012 16:17tried adding this code to my project file:
<Exec Command="start C:\test.txt" />
This doesn't fie up at all. When I do "AfterBuild" though, it works fine. So, what I think it is, that my publish is not set to "Web Deploy". Does anyone know if there is a way to make the "AfterPublish" work without publishing using Web Deploy setting.
Please advise. Thank you
יום ראשון 15 אפריל 2012 07:17
You cannot define AfterPublish and wish it will work, as it is not a defined target for you to override and will not be called by MSBuild/Visual Studio automatically.
What you should do is to attach it to WebDeployPublish target using AfterTarget,
<Target Name="AfterPublish" AfterTargets="MSDeployPublish"> <Exec Command="start C:\test.txt" /> </Target>
Then MSBuild/Visual Studio can pick it up.
This trick can be also used to implement other useful helpers during publish, as demonstrated in this article,
Lex Li (http://lextm.com)
- סומן כתשובה על-ידי lucy-liuModerator יום שישי 20 אפריל 2012 07:02