参考自:http://www.cnblogs.com/chenwolong/p/MiniProfile.html
直接从Nuget上下载
MiniProfiler
MiniProfiler.EFX 这个X根据EF版本而定
然后在视图页加上
@using StackExchange.Profiling;
@MiniProfiler.RenderIncludes()
然后在Global.asax中添加三处红框

然后在Web.config中的<system.webServer>节点下添加下列配置
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
大功告成,亲测有效
效果图如下:

本文详细介绍了如何在Entity Framework中集成MiniProfiler进行性能分析。通过从Nuget下载相应包,配置Global.asax和Web.config文件,即可实现对数据库操作的性能监控。亲测有效,附带实操步骤与效果展示。
6114

被折叠的 条评论
为什么被折叠?



