How to update a running asp.net application?
We have a running asp.net application which is accessed by various offices 开发者_StackOverflow中文版of the client worldwide (around 42 offices in 12 countries). Now after 8 months of hosting it we have to include updations in 6 pages and addition of 15 new asp.net pages. Now is there any way by which we could update the existing upside without taking it offline i.e. stopping it ?
This really depends on how you deployed the application, but generally the answer is yes - just add the new files and you'll be off and running. You might want to read up on ASP.Net Dynamic Compilation.
However, if you deployed your site as a pre-compiled application for deployment only, then the answer is no - you will require a full recompile and redeployment.
If you are adding source code to the application, the application domain will be recycled. If this is what you're worried about when you say "stopping" the application, then you should know that it may cause a noticeable delay (a few seconds), and your user's sessions will be reset if you're using InProc sessions, but the application will never appear to be unavailable otherwise.
You may also find the following article very helpful - especially the section entitled "Compilation Life Cycle" where it talks about application restarts. ASP.Net Application Lifecycle Overview.
As @Mendy said in the comments, just upload the new and modified files, and any new/modified files from the bin folder. I understand you not wanting to take it offline, but you will have to for the couple of minutes that it will take you to update files - if you don't then users will experience unpredictable behaviour when accessing it while you make the change.
You will also want to run a quick test before allowing the users back in, just to make sure you haven't missed anything, e.g. no broken links/redirects, all script/css/image files are loading fine, etc.
You could also use the app_offline.htm to tell your users that the site is temp down for improvements, etc. http://www.dontcodetired.com/blog/post/Quickly-Take-Down-an-ASPNET-Web-Site.aspx
If you really need 24/7 uptime, you might want to look at load balanced web servers - one can be taken down for updating while the other continues to serve. Note that this will need some careful management, with regard to how you handle your sessions.
精彩评论