I have an asp.net 4 e-commerce web site on my Windows Server 2008 R2 web server. I upload an updated DLL to the /bin folder and of course the site recompiles. It's a web site project, not web application. More times than not the site will not come back up, I'll get a service unavailable error (503 I think). I have to RDP into the server and do an IISRESET to bring it back up. Unfortunately this cycles everything on the server.
Why does this happen and how can I prevent it? How can I have the site recompile successfully when the /bin folder changes and not have IIS time out or whatever is causing this error?
Thank you.
That's a race condition between ASP.NET and the deployment. As the first application file or folder is touched, there will be an appdomain recycle, which will occur in rapid succession during the deployment. If it ends out of order, ASP.NET can be thrown off and remain in a broken state. This doesn't happen for most apps, but it can for some, especially those large sites under high load during deployment.
The solution is to 'touch' your web.config file after everything is finished. That will cause an appdomain recycle for just your site, and not require a reset on the whole server. By touch, just upload web.config again after your deployment has been completed.
Another option is to use App_Offline.htm during deployment.
Here are a couple video blogs I released on AppDomains and localized recycling that you may find useful:
Did you register the dlls? Regsvr32 and the DLLs path. If it is 32-bit you would want to use the regsvr32 in the syswow64 folder.Another thing you can do is to enable failed request tracing in IIS to find out exactly where and what the issue is. Hope this helps