I have a web application project in Visual Studio 2010, which has MS Deploy options configured for it. I can right click the project in Solution Explorer and kick-off "Build Deployment Package" which tells MSDeploy to create a deployment zip file. That internally depends on the Build target for the project. All that works.
Trouble is, I can't see how to get the MSDeploy packaging functionality to run as part of the Build target in Visual Studio. In other words, when I right click the project in Solution Explorer, and click plain old "Build," I'd like for it to also do the "Build Deployment Package."
"Why not just click Build Deployment Package, then", you ask? Because I really want the build target of my web application to be a dependency of another project in my solution which is a WIX installer. In other words, the WIX project has a single dependency which is my web application project. When I Build the WIX project, VS automatically builds the web application project, but does not build the deployment package. The WIX installer is using the deployment package as part of its installation process. In this workflow, either the WIX installer project will fail to build because it can't find files created by MSDeploy (bad), or it will find a stale MSDeploy package and use that without complaining (really bad). Sounds redundant to use both MSDeploy and Microsoft Installer, but I am taking queues from here. I like the idea of having an MSI that can be chained with other MSIs or incorporated into a GPO application.
If I simply try to manually add "Package" as a post build event to the web application project by inserting this into the raw csproj XML:
<Target Name="AfterBuild">
<CallTarget Targets="Package" />
</Target>
then the plain old build will fail because it will then depend on Package, and apparently the Package target depends on Build. Which is circular.
Maybe what I really, really want is a way to tell the WIX installer project to depend on the output of the "Build Deployment Package" target, or the Solution to use "Build Deployment Package" rather than "Build" in its Project dependency graph. Any ideas on that?
I do not think I want an MSBuild script that must be executed from the commandline, as when performing a scheduled TFS TeamBuild. I'd like to keep this as a VisualStudio task executed by a developer (me) with a monitor, keyboard and mouse randomly and many times a day. In fact, I want to say that I don't have access to TFS at all.