How do I use MSBuild on a post-build event in VS2010
I'm using VS2010 and want to perform a post-build action to compress my JavaScript etc:
See: http://yuicompressor.codeplex.com/
I've never used MSBuild or Postb开发者_运维技巧uild events so can anyone tell me how to add this ability to an existing web application.
Post build events are just windows batch scripts. You can use any command line tool if you want.
If you want deeper integration then you can hook in to msbuild. But if all you need is to zip up some files, just use something like 7zip and it's command line interface.
There is a neat little example of using a the built in variables, to make it easier to write the script - http://geekswithblogs.net/dchestnutt/archive/2006/05/30/80113.aspx
精彩评论