我尝试使用 EF Tracing Provider 检查生成的 SQL 语句,但现在我想使用 MiniProfiler,但看不到结果...
到目前为止我做了什么:
安装包:
在 MiniProfiler.cs 中取消注释初始化
public static void PreStart() { //... //TODO: If you are profiling EF code first try: MiniProfilerEF.Initialize(); //... }
在布局 View 中添加渲染(在关闭 body 标签之前):
@MiniProfiler.RenderIncludes()
但是相对于 miniprofiler,浏览器中没有显示任何内容... 我正在使用数据库优先方法。
我错过了什么吗?
最佳答案
应在 web.config 中添加以下代码:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
//...
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
关于entity-framework - 在带有 EF5 的 ASP.NET MVC 4 中使用 MiniProfiler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15833062/