性能工具MiniProfiler在Asp.Net WebForm跟踪EntityFramework
性能工具MiniProfiler在Asp.Net WebForm跟踪EntityFramework
1:安装MiniProfiler
使用Nuget安装:
2: 在Global.asax中添加下面代码:
void Application_BeginRequest()
{
if (Request.IsLocal)
{
MiniProfiler.Start();
}
}
void Application_EndRequest()
{
MiniProfiler.Stop();
}
void Application_Start(object sender, EventArgs e)
{
StackExchange.Profiling.MiniProfilerEF.Initialize();
}
3:在页面中添加
protected override void OnPreRender(EventArgs e)
{
Response.Write(StackExchange.Profiling.MiniProfiler.RenderIncludes());
base.OnPreRender(e);
}
4:浏览该页面
点击左上角会出现,点击sql出现:
分类: EntityFramework
作者: Leo_wl
出处: http://HdhCmsTestcnblogs测试数据/Leo_wl/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
版权信息查看更多关于性能工具MiniProfiler在Asp.Net WebForm跟踪EntityFramework的详细内容...