Is there any easy way to Deploy/Publish a website written in asp.net ? And what is the difference between deploy and publish ?
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.:
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.
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.
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.
- In IIS right-click Sites and click Add Website
- Set up a new web site as shown and click OK
- In Visual Studio (running with administrator privilege), right-click your ASP.NET web project, select Publish...
- Click the Profile heading and from the drop-down select New Custom Profile...
- Enter a profile name like "localhost44321", set up the profile as shown and click Publish
© 2022 - 2024 — McMap. All rights reserved.