Which is the right deployment model to use? RRS feed

  • Question

  • User-98294428 posted


    I'm a little confused.  As nearly as I can tell, there are now 3 different ways to deploy an ASP.Net application (Web setup project, Web Deploy, Publish).  So which one do I use?

    Ok, ok if I leave it at that, the answer is (correctly) "It depends".  So here are some details:

    I work for an ISV, and my web application will be installed by customers, so the deployment model needs to be as close as possible to the type of setup that you would get with an off-the-shelf windows application -- I have no ability to connect to the target server, it's not even my server.

    The project is written using Visual Studio 2005.  It began as a Web Site project, and we have since migrated it to a Web Application project.

    It must either install or ask the user to install .net 2.0 runtime if not present.

    It must allow me to distribute my assemblies, not my source code (no .cs files for the aspx pages).

    It only targets IIS 6 and up.

    It must create a web application, and configure it to use ASP.Net 2.0 (not v1, which seems to always be the default).

    It must create an application pool and associate the newly created web application with the new pool.

    It must install some 3rd party components, and create a virtual directory.

    I am familiar with msi technology, and have used both Wise and Installshield msi based tools to deploy Windows application. (I've never before deployed an ASP.Net application, though)

    On the web, I have found lots of scattered articles about how one technology or the other works (Web deploy/web publish/web setup), but I have found no definitive article that brings it all together.

    Maybe the answer is that I need to consider a professional installation tool.  Maybe the tools in VS are really intended for internal deployments from IT shops, and are not up to what I need.  If that's true, that's fine -- no hard feelings, I just need an answer.  The setup must be real, it must be professional, and it must be polished.

    Thursday, May 18, 2006 5:40 PM

All replies

  • User-1022063999 posted

     Aside from lots of problems getting things lined up correctly from one solution to the next, I'm finding I need to try to do this:

    Make my basic project a website (can't use project's anymore, the 2003 creature worked great, so it was done away with)

    But, once you do use a website, you can add a web deployment project (wbdproj) via the build menu.  This baby lets you work all kinds of magic, such as replacing web.config files cleanly, dependent on the configuration chosen.  play with the properties, but do not open the project file inside of VS, it will probably hang up VS forcing you to use the task manager to shut down VS.  Instead, edit the .wdbproj file directly with a text editor after you check it out in VS.  If you search around the net you will find there are some quite handy things you can do with the MSBUILD technology that it is implementing.

    However, this does not build an .msi.  But if you now add a web setup project and point it to the web deployment project, you will get an msi that works just great.

    I'm very pleased with the end result of this deployment model:  website -> _deploy project -> _install project => .msi file

    But I'm very unpleased with the poor documentation on how to make the _deploy project behave itself.






    Friday, May 23, 2008 4:04 PM
  • User2006178999 posted

    So JMarsh, you're saying that you're wanting to have a single install program that.. more or less... installs a WEB SITE on the target computer. Which also means u have to deal with problems like

    a) is .NET installed and which version
    b) is IIS installed .. and what happens f it isn't?
    c) configure IIS stuff, etc..

     ouch. ouch ouch ouch ouch... ouch.

    I think JustWantAnAnswer is right. There's two problems here.

    1) The web site 'code' which needs to be all baked and cooked.
    2) all the other stuff so the website can be accessed (eg. correct framework, iis, etc).

    I can't answer #2.

    for #1 -> JustWantAnAnswer is right about using Web Deployment Projects. In fact, that's perfect for the first half of the problem. In effect, you need to 'build' the web site to a temp location .. which can be another temp folder on your machine. This will 'deploy' the website to that folder, with all the proper files in place. So, for example, the source code will not be there but the html files will be. All dll's required will be generated and copyied across. It's just like a working web site, ready for production.

    Once this site has been deployed to this temp folder, you can then do 'all the rest of the stuff'. Meaning, u can zip this folder, stick it into some MSI installer or whatever, and have that MSI installer do all the rest of the stuff, like make sure the correct .NET framework is installed, check for iis, install other 3rd part apps, etc. Visual Studio comes with an MSI Installer project .. which is a project that defines what the installer does .. and when u build that project, it generates an MSI.

    So use WDP to build the website all baked and cooked. Then research about how to make MSI setup installers and use the folder which has the website deployed to, as the website you'll package inside the MSI installer.

    good luck!

    Saturday, May 24, 2008 7:57 AM