Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to not restart IIS every time I make changes to code?

I have my web application running. And every time I change some little peace of logic code I need to stop the app and wait for IIS to restart entirely.

Somewhere in the web I saw some guy saying that one of cool features of MVC5 (or maybe MVC6 on ASP.NET Core) that you can make changes "on the fly".

So can I not stop and restart IIS every time, or I just misunderstood something?

like image 813
Corio Avatar asked Mar 31 '17 10:03

Corio


People also ask

Do I need to restart IIS after changing Web config?

Changes to the web. config will trigger the app to be reloaded by IIS as soon as there are 0 connections left to the app. You can also stop and restart the app pool that the app is assigned to in order to make this happen. You do not need to stop and restart IIS itself.

Why is IIS reset required?

IIS resetting your server is never necessary. It causes extended downtime to your websites, and can leave your web server in an inoperable state.

Does restarting IIS restart app pool?

Compared to this, iisreset or restarting WAS causes the shutdown of ALL application pools. This includes waiting for requests in all application pools to finish, up to the shutdown time limit. This could mean up to a minute and 30 seconds of downtime from each application pool.


2 Answers

It depends on how the ASP.NET Core app is deployed. Essentially, its ability to make changes on the fly is owed to it being able to be deployed as just plain code, rather than as a compiled application. The web server essentially compiles it on the fly. However, for that to happen, you need to be using a web server than actually can compile it on the fly. IIS cannot. However, IIS can act as a reverse proxy for Kestrel, and Kestrel can compile on the fly. If you deploy the app in the traditional "compile and publish directly to IIS application directory" approach, then you will not benefit from this.

like image 55
Chris Pratt Avatar answered Oct 06 '22 00:10

Chris Pratt


Actually, you don't need to restart IIS after each deploy. Whenever a change is detected in DLLs, the app (not IIS) will recycle and re-load the new DLLs. It just impacts that particular application and reloads the app domain.

Also, editing the web.config in a web application will also recycle the app.

You can read more in this article.

like image 36
S.Dav Avatar answered Oct 05 '22 22:10

S.Dav