IIS App Pool/Restart and ASP.NET

后端 未结 2 925
滥情空心
滥情空心 2020-12-12 22:58

We are using IIS7 to host an asp.net web-based application. In this environment administrators and developers can deploy code to the application on a regular basis.

2条回答
  •  感动是毒
    2020-12-12 23:48

    The first part of ntziolis answer is a wee bit inaccurate. The worker process isn't being recycled or restarted, it just keeps running. If this were the case, then in shared pool environments you would have sites knocked out every time a new one was deployed.

    When you deploy a new ASP.NET application it's the site's "Application Domain" within the worker process is torn down, not the pool process.

    In addition pool recycling is a completely separate concept to deployment

    At this point in time in the commercial life of ASP.NET, during a deployment, a site will be in an inconsistent state until all of the site is deployed. There is still no good story about this from Microsoft at this time for single site on a single server deployments.

    This is why ASP.NET has the special App_Offline.htm page. It's there so you can enable that page, deploy and then turn it off.

    The second part of ntziolis answer is nearly correct but you don't need two sites or two application pools. You just need two file system folders that switch between being the physical folders for the site...if you're on a single server and not behind a load balancer or ARR.

    If your sites were on a web server behind a load-balancer or ARR then having two different sites would make sense, you could route requests from one site to the other and round-robin on each deploy.

    Obviously if there is a large amount of user generated content (uploaded files and the like) then you'd map a virtual directory in your site to a common location for this data.

    In larger scale deployments where your app is running across (for example) a load-balanced environment you can do more sophisticated deployments.

    For related questions please see:

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

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

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

提交回复
热议问题