5

I'm running an instance of umbraco 7. But I can't seem to set miniprofiler to work with it.

Set this on my global.asax:

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

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

Also defined the handler on the web.config:

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

Any help is truly appreciated.

antao
  • 767
  • 1
  • 9
  • 24

2 Answers2

10

MiniProfiler is built in to Umbraco v6 and v7. You don't have to manually setup it. All you have to do is to enable debug mode by setting key in AppSettings:

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

And load page with ?umbDebug=true query string parameter.

Ivan Doroshenko
  • 944
  • 7
  • 13
  • 3
    In Umbraco 7 at least you don't need the `appSettings` key - you just need to ensure that `debug="true"` is set as usual on the `` element of your `web.config` file. – Dan Diplo Jan 19 '16 at 08:42
  • I think you also need to set the appsetting for `EnableMiniProfiler` to true or you won't get the mini profiler still. – ProNotion May 11 '16 at 09:04
0

Does your global.asax file inherit from the umbraco global http class, or the one where you are writing this code? If the former, it won't work. Try using Web Activator instead. Or inherit from the umbraco global file in your global.asax.cs.

LiverpoolsNumber9
  • 2,384
  • 3
  • 22
  • 34