简体   繁体   中英

VS.NET: Doing a post-build step in a web project

I've got a Visual Studio 2010 solution with only a website in it. It contains lots of Javascript files which I would like to minimize automatically when doing a build. There's one good solution but it dpeends on the post-build step of .NET projects and a website does not have any build events.

One alternative is of course to run something on the commandline manually whenever doing a build. Is there any other way to integrate it into VS build process except the post-build step?

You can perform post build events on web projects if you install the VS 2010 Web Deployment Projects extension/power tool.

For how to add in to your solution, see this blog post .

You can uncomment the <Target Name="AfterBuild"> tag (as an example) inside the .wdproj file.

from my experience, its not possible, its just not a feature for websites, which are ment to be almost an xcopy deployment. if someone does know a way then please let us all know.

its a good idea to have a 1-click batch/powershell deployment script for these sort of projects, and well, all projects really. you can add the script to your VS IDE either via a macro, or Tools->External Tools... the inbuilt publish mechanism is fairly limited, doesn't even support SCP, so the script solution ends up as the work around again.

if you can, convert it to a web application, its a much better experience imo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM