Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • andrew shearer 506 posts 653 karma points
    Jul 26, 2019 @ 02:19
    andrew shearer
    1

    umbraco 8 and miniprofiler

    I was reading in https://umbraco.com/blog/umbraco-81-release/ about the easier access to miniprofiler, but when i add "/?umbDebug=true" to my rule still nothing shows. How do you get miniprofiler to show on the website?

    thanks

  • David Challener 80 posts 444 karma points c-trib
    Jul 26, 2019 @ 08:32
    David Challener
    0

    Hi,

    It looks like you just need to toggle the switch in the backoffice -> settings -> Profiling.

    Then when you visit a page it has a cookie stored that you want to show the miniprofiler. This will only work when you have debug=true in your web.config.

    PR with this amend in

  • andrew shearer 506 posts 653 karma points
    Jul 28, 2019 @ 20:02
    andrew shearer
    0

    hi - yes i have the backoffice setting ticked, and debug=true in web.config. Do i need to put something in the view file or does it get injected into the page markup automagically? thanks

  • David Challener 80 posts 444 karma points c-trib
    Jul 29, 2019 @ 08:06
    David Challener
    0

    Hi,

    It should just display the miniprofiler when you go to one of your pages.

    Cheers, David

  • andrew shearer 506 posts 653 karma points
    Jul 29, 2019 @ 19:31
    andrew shearer
    0

    The only thing i can think of is that my views are of type MyCustomUmbracoViewPage, not UmbracoViewPage directly. If miniprofiler is looking for the UmbracoViewPage type to inject itself into then there would need to be an alternate way for custom views.

  • David Challener 80 posts 444 karma points c-trib
    Jul 30, 2019 @ 08:40
    David Challener
    0

    Hi Andrew,

    From what I can see, the profiler is setup at boot time and either looks for the cookie called UMB-DEBUG, or a query string parameter umbDebug with a value of true. This will then start the profiler.

    You could be right though, if you're using your own ViewPage it doesn't fire. Just out of curiosity, what are you doing? Does it inherit from UmbracoViewPage?

  • andrew shearer 506 posts 653 karma points
    Jul 30, 2019 @ 19:25
    andrew shearer
    0

    hi - yes,MyCustomUmbracoViewPage<T> : UmbracoViewPage

  • David Challener 80 posts 444 karma points c-trib
    Jul 31, 2019 @ 10:47
    David Challener
    0

    Interesting - I can't replicate this not displaying.

    I've just created a dummy class to inherit from UmbracoViewPage and use this on my view but the miniprofiler still shows in the top right corner.

    Are you doing anything extra in your class?

    Can you strip it back to test (I'm now intrigued!) If you just use the UmbracoViewPage<> on your view does the miniprofiler display as expected?

    This was my dummy class for testing:

    public class CustomUmbracoViewPage<T> : UmbracoViewPage<T>
    {
        public override void Execute()
        {
        }
    }
    
  • andrew shearer 506 posts 653 karma points
    Jul 31, 2019 @ 20:03
    andrew shearer
    0

    hi David

    thanks for trying to replicate :)

    hmm interesting, no I changed back to UmbracoViewPage but it's still not showing.

    so at this point I have:

    • "?umbDebug=true" on url
    • "Activate the profiler by default" ticked in backoffice
    • debug="true" in web config
    • latest umbraco 8.1.1
    • UmbracoViewPage

    I wonder what i've done as it's essentially a vanilla install

  • alexnik 1 post 21 karma points
    Sep 11, 2020 @ 08:11
    alexnik
    0

    I had the same problem, vanilla install via nuget, ver. 8.7.0. Solved it by adding @MiniProfiler.Current.RenderIncludes() in the layout cshtml. You also need to add @using StackExchange.Profiling; at the top.

  • Markus Johansson 1911 posts 5757 karma points MVP c-trib
    Jan 15, 2021 @ 07:12
    Markus Johansson
    1

    I found that when you want to view backoffice requests as well you could go directly to the MiniProfiler-pages:

    mysite.com/mini-profiler-resources/results-index

    Will display a recent list of requests and provide navigation for details.

Please Sign in or register to post replies

Write your reply to:

Draft