.net EF监控 MiniProfiler
1.从NuGet上下载所需要的包:MiniProfiler.mvc,MiniProfiler,MiniProfiler.ef
2.Global.asax 加入
protected void Application_Start()
{
MiniProfiler.Settings.Results_Authorize = Request =>
{
#if DEBUG
return true;
#else
return false;
#endif
};
StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize();
}
protected void Application_BeginRequest()
{
if (Request.IsLocal)//这里是允许本地访问启动监控,可不写
· {
MiniProfiler.Start();
}
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}
3.在模板页中修改
<head>
@using StackExchange.Profiling;
</head>
<body>
@RenderBody()
@MiniProfiler.RenderIncludes()
</body>
4. web.config 加入 system.webServer节点
<system.webServer>
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
最新文章
- paper 126:[转载] 机器学习中的范数规则化之(一)L0、L1与L2范数
- docker containerd中的容器操作
- python语法笔记(四)
- 【Android Api 翻译1】Android Texting(2)Testing Fundamentals 测试基础篇
- ASP.NET MVC中使用ASP.NET AJAX异步访问WebService
- MVC-Model数据注解(一)-系统(DataAnnotations)
- MFC中spin control使用
- Android面试题集锦 (转)
- 一篇关于Maven项目的jar包Shell启动脚本
- OpenStack之Fuel架构及其工作原理
- MySQL 千万级 数据库或大表优化
- 【Python 06】汇率兑换1.0-1(IPO与字符串转数字)
- Findout之为什么公司内部不能使用SSH协议连接外网服务器
- jQuery文档操作
- Elasticsearch5.5 多机集群配置和x-pack安装配置
- LVN与其在Linux上的实现
- html form method 属性不支持put,delete请求方式,以及开启spring mvc的rest的方式
- 一些java的部署执行编译等命令
- Bootstrap-CL:标签
- 关于restful开发的疑惑
热门文章
- 矩阵压缩写法 scipy spark.ml.linalg里都有,CRS,CCS
- Java迭代器原理
- 【Hadoop】YARN 原理、MR本地&;YARN运行模式
- ES怎么进行字段添加索引,并保留原有数据
- windows 2003子目录权限丢失及子目录权限无法继承更改的解决方法
- Tomcat 启动或者发布项目时提示Publishing failed:Resource /xxxx does not exist
- Material Design (二),TextInputLayout的使用
- Android学习(十) SQLite 基于SQL语句的操作方式
- 通过特定获取获取电脑外网IP地址
- ios 使用gcd 显示倒计时