zoukankan      html  css  js  c++  java
  • 性能工具MiniProfiler在Asp.Net WebForm跟踪EntityFramework

    http://www.xuebuyuan.com/356638.html

    选择MiniProfiler.EF 默认会把MiniProfiler安装上,笔者程序是Asp.Net WebForm 不需要安装MiniProfiler.MVC3
     
    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出现:
     
  • 相关阅读:
    第一次作业 黄学才
    shell重定向符
    umask
    Linux下新建用户自动复制文件
    任务计划cron
    vsftp配置
    xinetd.d配置格式
    php安装
    第五次作业
    第四次作业
  • 原文地址:https://www.cnblogs.com/shiningrise/p/5572662.html
Copyright © 2011-2022 走看看