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 o开发者_运维问答f .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?
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.
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.
精彩评论