开发者

Deploying ASP.NET to single server without service interruption [duplicate]

This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

How Do I deploy an application to IIS while that web application is running

How to deploy an ASP.NET Application with zero downtime

Publishing/uploading new DLL to IIS: website goes down whilst uploading

Is smooth deployment possible with componentized ASP.NET MVC apps?

I have a website that runs on a single server (so no load balancers). When I make a deployment using MSDeploy, all the files in my virtual directory get overwritten. This is expected, of course. The problem is that my users get interrupted for 15-30 seconds or so while IIS resets. Not a big deal, but it wou开发者_如何转开发ld be better if there were 0 interruption. I don't think this is avoidable, but wanted to check to see if anybody on SO knew something I didn't


btw the approach as I mentioned here: How to deploy an ASP.NET Application with zero downtime is the approach that even we follow at my company and it has worked out well for us till now. We have an app developed that aids us in the same..

Its integrated with Teamcity a continuous integration tool that tells us the progress of the deploy and logs the same.


If your code or web.config was changed, IIS will restart the application. There may be a way around that, but the amount of work involved would far outweigh the benefits.


It is do-able, it just depends on how complicated you want your build/deploy to be.

For example you could:

  • Deploy your site to a new folder (i.e. sitename_deploy)
  • Create a virtual directory to the new folder
  • Force a load of the new site (so that IIS starts up the site)
  • Rename your existing site directory (i.e. sitename_old)
  • Rename the new site folder to the correct live folder name (i.e. sitename)
  • Remove your old site (i.e. sitename_old)
  • Remove the virtual directory you created in step 2.

It should be said that I haven't actually tried this so it might be rubbish and IIS may restart the site when the virtual directory path changes. ;-) If it does work, your only down time will be the time it takes to rename the two directories.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜