MiniPorfiler監(jiān)控 步驟說明
1.引用程序集:MiniProfiler 和 MiniProfiler.EF6
2.web.config添加配置:
<system.webServer>
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/" verb="" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
3._Layout 添加界面顯示:
@using StackExchange.Profiling;
@MiniProfiler.RenderIncludes();
- Global.asax添加啟動項
protected void Application_BeginRequest()
{
if (Request.IsLocal)
{
MiniProfiler.Start();
}
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}