Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

How to update ASP.NET Core files without stop IIS Application & Pool in .NET5?

Every time need to stop the IIS Application or Pool to update

or system will show The action can't be completed becacuse the file is open in w3wp.exe

I expect like asp.net or mvc, you don't need to stop IIS to update.


Right now my way, I drop a file called app_offline.htm (case sensitive) to my application folder. Let IIS auto stop my application then I update it

From this article iis - How can I update ASP.NET Core app over an existing/running site without stopping the web server? - Stack Overflow

question from:https://stackoverflow.com/questions/65914196/how-to-update-asp-net-core-files-without-stop-iis-application-pool-in-net5

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If we use asp.net core, we cannot achieve non-stop update projects.

When IIS is running your website process, if a request comes in at this time, the dll/exe file will be locked. If an update item is released at this time, the dll/exe cannot be replaced successfully and an error will be reported.

As for why asp.net can achieve uninterrupted updates, because the difference between core and asp.net is that asp.net applications are completely deployed in IIS, while asp.net core uses IIS as a proxy server. We can think of the core application as a console application. So to update the asp.net core application must stop IIS.

The solution I thought of was to provide a transition site.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...