Copied to clipboard

Flag this post as spam?

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


  • James Gaisford 22 posts 165 karma points
    May 28, 2015 @ 10:06
    James Gaisford
    2

    Getting started with miniprofiler and Umbraco 7

    Hi All,

    Starting to look at some performance issues with a current project and saw that MiniProfiler is included in Umbraco. A couple of different blogs / forum posts have provided conflicting views as to how to set it up.

    To configure MP, it looks like I have to do the following;

    1. Set umbracoDebugMode="true" in the appSetting section of the web.config in the root.
    2. Set compilation debug="true" in the web.config in the root.
    3. Add @MiniProfiler.RenderIncludes() to the view I want miniprofiler to render in.
    4. Navigate to the appropriate URL with ?umbDebug=true on the querystring.

    Despite adding all these things, I still can't get mini profiler to display. Can anyone point me in the right direction?

    Thanks, James.

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    May 28, 2015 @ 10:29
    Alex Skrypnyk
    0

    Hi James,

    We have such configuration:

    1. umbracoDebugMode="false"
    2. compilation debug="false"
    3. remove this code @MiniProfiler.RenderIncludes()
    4. add ?umbdebug=true to query string

    And you will see MiniProfiler little popup at right top corner of the site.

    Thanks, Alex

  • James Gaisford 22 posts 165 karma points
    May 28, 2015 @ 13:44
    James Gaisford
    0

    Hi Alex,

    Thanks for the quick reply. I've updated my config as you suggested, and removed the @MiniProfiler.RenderIncludes(), but I still see nothing.

    I understand MiniProfiler will be available both in the website, and in the back office. I have checked both - to make sure my website code isn't interfering somehow with MiniProfiler - but it doesn't display in either.

    There must be something really simple I'm missing!!

    Thanks, James.

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    May 29, 2015 @ 09:51
    Sebastiaan Janssen
    8

    Almost:

    1. umbracoDebugMode doesn't matter unless you're on a pretty old version, else it should be true
    2. compilation debug needs to be true
    3. remove MiniProfiler.RenderIncludes() indeed
    4. add ?umbDebug=true
    5. runAllManagedModulesForAllRequests needs to be true

    Of course it could be that the css in your site makes the miniprofiler appear behind some elements, view the source of the page and look for <script async type="text/javascript" id="mini-profiler" near the end of the page.

  • Nathan Skidmore 63 posts 251 karma points c-trib
    Mar 06, 2017 @ 17:39
    Nathan Skidmore
    0

    Hi Sebastiaan,

    Thanks for the tip around checking the source code of the page to see if the script is there. I can see the script, but the profiler is not visible. I have checked the styles on the elements that were generated but there doesn't appear to be anything hiding it. On the front end of my site, I don't see any errors in the console.

    I have tried the backoffice as I understand it should work there too. However the backoffice is throwing a console error:

    Refused to get unsafe header "X-MiniProfiler-Ids"
    

    I believe this is related to CORS. Any ideas? I am doing these tests on a website that is only available Internally within the business I work. I don't think this is a factor but I thought I should mention it.

    Thanks,

    Nathan

  • David Challener 80 posts 444 karma points c-trib
    May 25, 2017 @ 09:25
    David Challener
    1

    I had a similar issue, it was definitely running but not showing anything to the screen.

    I managed to track it down to my rewrite rules (these are worth disabling to see if you can narrow it down to a particular rule)

    My particular problem was with the default IIS rewrite rule to append the trailing slash to the URL.

    Hope this helps others. David

  • Janae Cram 63 posts 439 karma points MVP 7x c-trib
    Sep 14, 2017 @ 19:57
    Janae Cram
    7

    I have a similar built-in rewrite rule that was causing me problems. My rule was:

    <rewrite>
        <rules>
            <!-- Inspired by https://our.umbraco.org/forum/developers/api-questions/49139-Add-trailing-slash-but-still-respons-without#comment-247196 -->
            <rule name="AddTrailingSlashRule" stopProcessing="true">
            <match url="(.*[^/])$" />
            <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_URI}" pattern="dtgePreview=1" negate="true" />
                <add input="{URL}" pattern="/umbraco_client" negate="true" />
                <add input="{URL}" pattern="/umbraco" negate="true" />
                <add input="{URL}" pattern="/install" negate="true" />
                <add input="{URL}" pattern="/media" negate="true" />
                <add input="{URL}" pattern="/assets" negate="true" />
                <add input="{URL}" pattern=".axd" negate="true" />
                <add input="{URL}" pattern=".ashx" negate="true" />              
            </conditions>
            <action type="Redirect" url="{R:1}/" />
            </rule>
        </rules>
    </rewrite>
    

    I added in the following line inside the conditions to resolve the issue:

    <add input="{URL}" pattern="/mini-profiler-resources" negate="true"/>
    

    Hope that helps someone else who runs into the same issue as well :)

  • Mark Bowser 273 posts 860 karma points c-trib
    Oct 23, 2019 @ 16:17
    Mark Bowser
    1

    Every so often I find this answer helpful and try to high five it only to find out I already have :)

  • Mike Masey 39 posts 253 karma points MVP 5x c-trib
    Dec 17, 2019 @ 16:52
    Mike Masey
    0

    Just came accross this issue and this solved it for me too. Nice one Janae #H5YR

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Apr 27, 2018 @ 05:01
    Peter Gregory
    0

    Janae you saved the day!

Please Sign in or register to post replies

Write your reply to:

Draft