How to Deploy/Publish an ASP.NET website?
Asked Answered
N

4

11

Is there any easy way to Deploy/Publish a website written in asp.net ? And what is the difference between deploy and publish ?

Nashua answered 14/3, 2009 at 19:27 Comment(0)
S
10

Here is a site that shows different techniques how to accomplish this task. There are many techniques that can be utilized as a deployment strategy for your web application.:

Beansoftware How to Deploy ASP.NET Web Application

Shult answered 14/3, 2009 at 19:31 Comment(1)
The information in this article is a little dated now. Check out weblogs.asp.net/scottgu/archive/2010/07/29/… for the VS2010 options.Chromolithography
S
8

Alt + B + H combination (opens publish window for ASP.NET web site / application) is the most simple way to deploy an application to the required location.

Publish used for compiling and deploying application to server.

Suckerfish answered 14/3, 2009 at 19:47 Comment(0)
S
6

Well, it depends on what you're trying to accomplish from an uptime/availability point of view. The publish/xcopy/installer options are interesting but all neglect to address the issue that it takes time for those options to complete. From the time the first file is copied into the directory to the time the last file is copied in the site is in an inconsistent state.

The ASPX files may refer to data-layer objects that aren't in the bin directory yet, or the bin directory may have a DLL w/a changed set of params on a function, but the aspx hasn't been installed yet, so the aspx is still looking for the old function. In short because the deployment isn't an atomic process you can/will have problems.

We've addressed this issue by installing the new files to a new directory, and then going into IIS and changing the website to point to the new directory. This makes the change an atomic process and makes things much smoother. Is it perfect? Nope. You can have viewstate issues or session issues (session is preserved, but maybe the new code looks for something in session that the old code didn't set) but it still makes the process much smoother.

Of course none of these solutions address the other non-atomic part of upgrading the website... the database. Again, the process of changing the DB schema takes time. Do you upgrade the code first or the database first? Can the DB change work w/out the code change (a new column that supports null or has a default) or can the code change work w/out the DB change (removing a column)? That's a case-by-case analysis, and isn't addressed by any of these solutions

Of course, if you can kick your users off the site for a period of time then life is easier, but if you're trying to achieve 100% uptime then it's not so simple.

Swank answered 14/3, 2009 at 20:2 Comment(0)
F
1

Sometimes it's not practical to set up Web Publish to your desired target. If that's the case you might still be able to publish to your local machine (as outlined below) and then XCOPY deploy to your target.

  1. In IIS right-click Sites and click Add Website
  2. Set up a new web site as shown and click OK enter image description here
  3. In Visual Studio (running with administrator privilege), right-click your ASP.NET web project, select Publish...
  4. Click the Profile heading and from the drop-down select New Custom Profile...
  5. Enter a profile name like "localhost44321", set up the profile as shown and click Publish enter image description here
Foam answered 2/11, 2016 at 22:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.