我把它归结为最小的例子:
测试.aspx
(后面的代码是空的)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="C3.Pages.Test" %>
<%@ Import Namespace="StackExchange.Profiling" %>
<!DOCTYPE html>
<body>
<%=MiniProfiler.RenderIncludes() %>
</body>
全球.asax
protected void Application_BeginRequest()
{
if (Request.IsLocal)
{
MiniProfiler.Start();
var ignored = MiniProfiler.Settings.IgnoredPaths.ToList();
ignored.Add("WebResource.axd");
MiniProfiler.Settings.IgnoredPaths = ignored.ToArray();
}
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}
这会产生结果:
谁能向我解释这里发生了什么?我希望只有一个显示。