Application pool
with Classic mode
doesn’t have an impact on this feature. On my side, the application_Start event works properly.
Please ensure that App_global.asax.dll
located in the BIN folder. We could clean, rebuild the project, and deploy it again. Moreover, during the Application_start event, we had better not write the IIS log or write/modify a database, this commonly leads to a permission issue, which seems not working.
Besides, you could verify the result by using the IIS log.
public class Global : System.Web.HttpApplication
{
public static int a = 34;
protected void Application_Start(object sender, EventArgs e)
{
a = a + 45;
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
Response.AppendToLog("Application BeginRequest...."+a.ToString());
}
}
This will generate a line of record in the IIS log.
2020-08-26 05:49:10 ::1 POST /WebForm1.aspx
Application+BeginRequest....79 8001 - vabqia969VM
Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/84.0.4147.135+Safari/537.36
http://localhost:8001/WebForm1.aspx 200 0 0 3
Please refer to the below link for troubleshooting.
Application_start not working