Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update a running asp.net core application?

I have a Asp.Net Core MVC application running on Windows Server 2008 R2 with IIS. But every time I update this application, I need to manually stop the applicationPool in IIS, and restart the applicationPool after I finish updating the app. Otherwise it will tel me "the xxx.dll is in use by other progress".

Is there any way to make this process easier?

like image 233
John Avatar asked May 13 '17 09:05

John


People also ask

How do I update my Entity framework Core?

Right-click anywhere on the design surface, and select Update Model from Database... In the Update Wizard, select the Refresh tab and select your table then click Finish button.


1 Answers

A workaround For Windows with no down time and I am regularly using is:

  1. Rename running .NET core application dll to filename.dll.backup
  2. Upload the new .dll (web application is available and serving the requests while file is being uploaded)
  3. Once upload is complete recycle the Application Pool. Either Requires RDP Access to server or function to recycle application pool in your hosting control panel.

IIS overlaps the app pool when recycling so there usually isn’t any downtime during a recycle. So requests still come in without every knowing the app pool has been recycled and the requests are served seamlessly with no downtime.

I am still searching for more better method than this..!! :)

January 2022 - for Linux

For Linux, we use Openresty nginx with Lua script to hold (sleep) incoming requests for few seconds until the service running .NET Core or .NET 5 or .Net 6 application restarts and then we release the threads we had hold.

Refer: https://github.com/basecamp/intermission

like image 160
Bharat Vasant Avatar answered Nov 11 '22 05:11

Bharat Vasant