How To Debug Your Umbraco 7 Website

None of us are perfect and when we start building a new website we will create bugs, make mistakes and do some very silly things at times.  In today's guide, I'm going to cover some of the inbuilt tools available to you, as a developer, to make your life a little easier :)


Out of the box Umbraco 7 comes with mini-profiler installed. Mini profiler is a Nuget package (more information available here) written by the guys at StackOverflow. As Mini Profiler is installed out of the box, in order to start using it with Umbraco, all we need to do is configure it correctly... simples :) When using mini-profiler, the first thing you should do is make sure that you have debugging enabled in your web.config, without that it will never appear. To do that, find the line that looks similar to this (around line 111) and makes sure the debug part is true.
    <compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.5">
In production you will never want to deploy this, so I would recommend using web.config transforms using slow cheetah to get around the problem, more information about this can be found here. There are a few ways to show the mini-profiler on a page. The most primitive one is via code, in the razor view that you want the profiler to display, add the following code:
@using StackExchange.Profiling;

When you load your website, you should see a little red box in the top left-hand corner like so: umbraco_7_mini_profiler

The Easy Way

Ok.. so the method above is the sure fire way of testing the mini-profiler is configured and works correctly. You may be thinking that adding all this code in your views isn't ideal and luckily there is an easier way to get it working. All you need to do is append '?umbdebug=true' to the end of your Url and magically the mini-profiler should appear! umbraco_7_mini_profiler_query_string


In previous versions of Umbraco you had to have an app setting, like this:
<add key="umbracoDebugMode" value="true" />
This is NOT needed anymore. Another feature that is now obsolete is the use of one of the query string paramateres. Historically, by adding "?umbDebugShowTrace=true' to the end of any Url Mini-Profiler would show a stacktrace, again, this doesn't work anymore.


In today's guide, we've covered how you can get extra information out of Umbraco using Mini-Profiler. Mini profiler is useful for debugging macro errors, performance improvements etc... Out of the box Umbraco ships with the Min Profiler package so you will not need to install it. To get it running simply add the debug=true flag in the web.config file and then use one of the methods above to enable it.

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

Back to top
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-35662136-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + ''; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();