我的 Global.asax 中有以下代码:
void Application_EndRequest(object sender, EventArgs e)
{
HttpApplication application = sender as HttpApplication;
HttpContext context = application.Context;
string path = context.Request.Path;
string contentType = context.Response.ContentType;
System.Diagnostics.Debug.WriteLine("-----------------------------------");
System.Diagnostics.Debug.WriteLine("Path: " + path);
System.Diagnostics.Debug.WriteLine("ContentType:" + contentType);
}
我在站点的根目录 (~/Help) 有一个帮助文件夹,其中包含静态 .htm 文件。我注意到并非所有这些文件都通过 EndRequest 运行。有时我会看到正在记录的页面中的资产(例如 .js 文件),但看不到 htm 文件本身。有时他们确实会被记录下来。
为什么不是所有这些文件都通过 EndRequest 运行,我如何确保它们运行?