ASP.net C# requires IIS restart when new DLL copied to BIN directory

荒凉一梦 提交于 2019-12-03 13:48:07
Wessel Kranenborg

When you put an app_offline.htm file in the wwwroot of your main domain the IIS site goes offline. This is default behavior of IIS as Scott Gu described. When you do this all dlls can be safely overwritten. And when you delete the app_offline.htm file your application will be start up the next time a request comes.

Read more about app_offline.htm here and here.

Basically, if you place a file with this name in the root of a web application directory, ASP.NET 2.0 will shut-down the application, unload the application domain from the server, and stop processing any new incoming requests for that application. ASP.NET will also then respond to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file (for example: you might want to have a “site under construction” or “down for maintenance” message).

This provides a convenient way to take down your application while you are making big changes or copying in lots of new page functionality (and you want to avoid the annoying problem of people hitting and activating your site in the middle of a content update). It can also be a useful way to immediately unlock and unload a SQL Express or Access database whose .mdf or .mdb data files are residing in the /app_data directory.

Once you remove the app_offline.htm file, the next request into the application will cause ASP.NET to load the application and app-domain again, and life will continue along as normal.

As far as i know, it is not necessary to do iisreset when you add a dll to the bin folder. The dll should be loaded automatically from the bin.

You should do iisreset when you add a new dll to the global assembly cache.

Can you stop that website in IIS while your are copying the dlls and then start it again? Because it will not halt other websites hosted in same IIS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!