MiniProfiler 监控运行效率
1.安装

2.Global.asax
(1)Application_Start 注意这里项目用的EF那个版本
StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize();
(2)Application_BeginRequest中添加
StackExchange.Profiling.MiniProfiler.Start();
(3)void Application_EndRequest(object sender, EventArgs e)
{
StackExchange.Profiling.MiniProfiler.Stop();
}
3.页面上添加
@using StackExchange.Profiling;
@StackExchange.Profiling.MiniProfiler.RenderIncludes()
4 .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>


浙公网安备 33010602011771号