ASP.net C # requires restarting IIS when a new DLL is copied to the BIN directory

We get a problem in which every time we copy the dll to the bin directory, our main domain on the website stops and the only way to get it back is to restart the "WWW Publishing Service".

We are launching a website that contains several IIS applications running on the same server, where each of these applications is configured to run different application pools.

We have a large code base that contains over 280 aspx pages throughout the site. Our main domain contains about 100 aspx pages, while subdomains contain 15 or 20 each.

When we build, we are currently creating a bunch of dlls that we manually copy to the bin directory for production servers. Once we do this, IIS obviously starts processing, compiling each of the aspx pages and the code behind. At this point, the site essentially stops (sometimes it needs to be restarted - by restarting the web publishing service) to wake it up again).

Curiously, this only happens when we deploy the IIS application of the primary domain, i.e. www. If we decompose the bin file into a subdomain in the same way, it works almost instantly.

Even if I do iisreset.exe, this does not seem to fix the problem.

A few questions:

  • Is there a way to speed up the current process so that we do not restart the server?
  • Were there obvious changes or code updates that would necessitate a restart of the service (sometimes we run iisreset, but this does not seem to bring it back to life)?

Some specifications:

  • Code written in: C #
  • .net framework: 2.0
  • Server: Windows Web Server 2008
  • iis version: IIS7
  • Database: MSSQL 2008 Standard

Any help would be greatly appreciated. Thanks in advance.

+7
source share
3 answers

When you install the app_offline.htm file in wwwroot of your primary domain IIS application, this application goes offline. This is the default behavior for IIS, as described by Scott Gu. When you do this, all dlls can be safely overwritten, and when you delete app_offline.htm , your application will be launched the next time the request appears.

Read more about app_offline.htm here and here .

Basically, if you put a file with this name in the root of the web application directory, ASP.NET 2.0 will disable the application, unload the application domain from the server and stop processing any new incoming requests for this expression. Then ASP.NET will respond to all requests for dynamic pages in the application by sending the contents of the app_offline.htm file (for example: you might want to create a “site under construction” or “down for maintenance”).

This provides a convenient way to remove the application during large changes or copy a large number of new page functions (and you want to avoid the annoying problem of getting and activating your site in the middle of updating the content). It can also be a useful way to immediately unlock and unload the SQL Express or Access database, the .mdf or .mdb data files are in the / app _data directory.

After deleting the app_offline.htm file, the next request to the application will force ASP.NET to load the application and the application area again, and life will continue as usual.

+12
source

As far as I know, there is no need to do iisreset when adding dll to bin folder. Dll should be loaded from the basket automatically.

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

+3
source

Can you stop this site in IIS while you copy the DLL and then run it again? Because it will not stop other sites hosted on the same IIS.

0
source

All Articles