EF框架 监控小工具 MiniProfiler
2016-10-14 10:51
417 查看
一、NuGet安装:
MiniProfiler
MiniProfiler.EF6
如果在MVC中使用则再多安装
MiniProfiler.MVC(X) //X:mvc版本号
二、web.config 中添加
三、Global.asax.cs
页面呈现:在body中添加
呈现结果:
这样就可以实地检测喽。
MiniProfiler
MiniProfiler.EF6
如果在MVC中使用则再多安装
MiniProfiler.MVC(X) //X:mvc版本号
二、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>
三、Global.asax.cs
protected void Application_Start(object sender, EventArgs e) { // 在应用程序启动时运行的代码 ※必须要放置在数据库初始化前 MiniProfilerEF6.Initialize(); // 数据库初始化 Database.SetInitializer<DataBaseCenter.DB.BIContext>(null); }
protected void Application_BeginRequest(object sender, EventArgs e) { if (Request.IsLocal) MiniProfiler.Start(); }
protected void Application_EndRequest() { if (Request.IsLocal) MiniProfiler.Stop(); }
页面呈现:在body中添加
<%= Request.IsLocal ? StackExchange.Profiling.MiniProfiler.RenderIncludes().ToString() :"" %>
呈现结果:
这样就可以实地检测喽。
相关文章推荐
- MiniProfiler工具介绍(监控EF生成的SQL语句)--EF,迷你监控器,哈哈哈
- asp.net mvc ef 性能监控调试工具 MiniProfiler
- 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)(转)
- 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)
- 1.采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)
- MVC教程--MiniProfiler.EF监控调试MVC和EF的性能
- 使用 MvcMiniProfiler 监控EF 4.1 with MySQL Provider
- 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)
- 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)
- 采用MiniProfiler监控EF与.NET MVC项目
- 采用MiniProfiler监控EF与.NET MVC项目
- MiniProfiler监控EF与.NET MVC项目
- 性能工具MiniProfiler在Asp.Net WebForm跟踪EntityFramework
- 性能工具MiniProfiler在Asp.Net WebForm跟踪EntityFramework
- ASP.NET MVC5 使用MiniProfiler 监控MVC性能
- MiniProfiler(MiniProfiler.EF6监控调试MVC5和EF6的性能)
- ASP.NET MVC5使用MiniProfiler监控MVC性能
- 开发同学的福利--mysql监控工具sqlprofiler,类似sqlserver的profiler工具
- 性能工具MiniProfiler在Asp.Net WebForm跟踪EntityFramework
- MiniProfiler 网站性能测试工具使用