I recently signed up for ASP.NET hosting on a server that uses LAMP as a front-end and proxies ASP.NET requests to a back-end IIS server. The setup actually works fine, and with a few hiccups (ASP.NET routing doesn't work, so I had to configure mod_rewrite instead), my site is working OK.
One of the advantages to hosting on a pure IIS server is that it monitors filesystem activity, and when a page or assembly is modified, it reloads that file.
This doesn't work with an Apache front-end, so the quickest workaround is to
That's fine for forcing a re-read of a file, but if you need to clear the cache, or you have static variables that are persisting data and you want them cleared, you need to unload the running assembly.
Alberto Venditti[^] wrote an excellent article, Recycling IIS 6.0 application pools programmatically[^] which proposes one programatic way to recycle the application pools; however, his approach requires knowing the name of the site as it is configured in IIS, and some other information to which you might not have access.
My approach is simpler, and consists of a short Web Form:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="recycle.aspx.cs" Inherits="utility_recycle" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<form id="form1" runat="server">
<div>Recycling... <%= message %></div>
public partial class utility_recycle : System.Web.UI.Page
public string Message;
protected void Page_Load(object sender, EventArgs e)
Message = "Success";
catch (Exception ex)
Message = "Failed: " + ex.Message;