protected void Application_Start()
{web
MiniProfiler.Settings.Results_Authorize = Request =>
{
#if DEBUG
return true;
#else
return false;
#endif
};mvc
StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize();
}
protected void Application_BeginRequest()
{
if (Request.IsLocal)//這裏是容許本地訪問啓動監控,可不寫
· {
MiniProfiler.Start();spa
}
}3d
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}blog
<head>ci
@using StackExchange.Profiling;it
</head>io
<body>
@RenderBody()
@MiniProfiler.RenderIncludes()
</body>模板
<system.webServer>
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>監控