I have a web application project in Visual Studio 2010 that is configured with MS Deploy settings. I can right-click the project in Solution Explorer and run the "Build Deployment Package", which tells MSDeploy to create a zip file for deployment. It depends on the build purpose for the project. Everything that works.
The problem is that I cannot figure out how to get the MSDeploy packaging functionality to run as part of the Build object in Visual Studio. In other words, when I right-click a project in Solution Explorer and click "Old", I would like it to run the "build deployment package" as well.
“Why not just click Build Deployment Package, then ask? Because I really want the build goal of my web application to be dependent on another project in my solution, which is a WIX installer. In other words, a WIX project has one dependency which is my web application project. When I create a WIX project, VS automatically creates a web application project but does not create a deployment package. The WIX installer uses the deployment package as part of the installation process. In this workflow, either The WIX installer will not be created because it will not be able to find the files created by MSDeploy (bad), or it will find the outdated MSDeploy package and use it without complaint (very bad). It sounds superfluous to use both MSDeploy and Microsoft Installer, but I take the lines from here . I like the idea of having an MSI that can be linked to other MSIs or included in a GPO application.
If I just try to manually add the “Package” as a post-build event to the web application project by pasting it into the csproj source XML file:
<Target Name="AfterBuild"> <CallTarget Targets="Package" /> </Target>
then a simple old assembly will fail because it will depend on the package, and apparently the purpose of the package depends on the assembly. Which is circular.
Maybe I really want the WIX installer project to depend on the output of the goal “Build deployment package” or “Use deployment build package” instead of “Build” in my Project Dependency Graph. Any ideas on this?
I do not think that I need an MSBuild script that should be executed from the command line, as when executing the planned TFS TeamBuild. I would like to save this as a VisualStudio task, performed by the developer (me) using a monitor, keyboard and mouse randomly and many times a day. In fact, I want to say that I do not have access to TFS at all.