【问题标题】:Using MiniProfiler in ASP.NET MVC 4 with EF5在带有 EF5 的 ASP.NET MVC 4 中使用 MiniProfiler
【发布时间】:2013-04-05 21:34:48
【问题描述】:

我尝试使用 EF Tracing Provider 检查生成的 SQL 语句,但现在我想使用 MiniProfiler,但我无法看到结果...

到目前为止我做了什么:

  • 安装包:

  • 在 MiniProfiler.cs 中取消注释初始化

public static void PreStart()
{
    //...
    //TODO: If you are profiling EF code first try: 
    MiniProfilerEF.Initialize();
    //...
}
  • 在布局视图中添加了渲染(在关闭body标签之前):

    @MiniProfiler.RenderIncludes()
    

但是相对于 miniprofiler,浏览器中没有显示任何内容... 我正在使用数据库优先的方法。

我错过了什么吗?

【问题讨论】:

    标签: entity-framework asp.net-mvc-4 mvc-mini-profiler


    【解决方案1】:

    下面的代码应该添加到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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-06
      • 2013-09-18
      • 1970-01-01
      • 2014-08-24
      • 1970-01-01
      相关资源
      最近更新 更多