Search code examples
asp.net-mvcasp.net-mvc-3profilingmvc-mini-profiler

Configuring MvcMiniProfiler


I'm trying to configure mvc miniprofiler with my asp.net mvc 3 application. The problem is that I can't access MiniProfiler class in my views (I'm using webforms viewengine). I have tried a few things

  • Added namespace under page directive in web.config (main web.config)
  • Added namespace under page directive in web.config (web.config in views folder)
  • import namespace in view

But when I write

<%var profiler = MiniProfiler.Current;%>

in my view it announces that MiniProfiler does not exist in current context.


Solution

  • Did you include the proper namespace in your views:

    <% var profiler = MvcMiniProfiler.MiniProfiler.Current; %>