【问题标题】:Miniprofiler and umbracoMiniprofiler 和 umbraco
【发布时间】:2014-03-06 16:02:14
【问题描述】:

我正在运行 umbraco 7 的实例。但我似乎无法设置 miniprofiler 来使用它。

在我的 global.asax 上设置这个:

    protected void Application_BeginRequest()
    {
        if (Request.IsLocal)
        {
            MiniProfiler.Start();
        }
    }

    protected void Application_EndRequest()
    {
        MiniProfiler.Stop();
    }

还在 web.config 上定义了处理程序:

 <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />

非常感谢任何帮助。

【问题讨论】:

    标签: umbraco mvc-mini-profiler umbraco7 mvcminiprofiler


    【解决方案1】:

    MiniProfiler 内置在 Umbraco v6 和 v7 中。您不必手动设置它。您所要做的就是通过在 AppSettings 中设置密钥来启用调试模式:

    <add key="umbracoDebugMode" value="true" />
    

    并使用 ?umbDebug=true 查询字符串参数加载页面。

    【讨论】:

    • 在 Umbraco 7 中,至少您不需要 appSettings 键 - 您只需要确保在您的 web.config 文件的 &lt;compilation&gt; 元素上照常设置 debug="true"
    • 我认为您还需要将 EnableMiniProfiler 的 appsetting 设置为 true,否则您将无法获得迷你分析器。
    【解决方案2】:

    您的 global.asax 文件是继承自 umbraco 全局 http 类,还是您正在编写此代码的类?如果是前者,那就不行了。尝试改用 Web Activator。或者从 global.asax.cs 中的 umbraco 全局文件继承。

    【讨论】:

      猜你喜欢
      • 2022-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多