Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MvcMiniProfiler 1.9 - Step method not being recognized by VS or by the runtime

I just installed MvcMiniprofiler via NuGet in VS 2010.

I am able to start the profiler and its working smoothly. The problem is that i want to wrap a piece of code in the "Step" method. I followed the example and am using the using syntax.

e.g.

using(profiler.Step("A"))
{
    // some code to be profiled
}

The problem is that neither the asp.net compiler nor visual studio is recognizing what the Step method is and at run-time gives me a YSOD saying.

Compiler Error Message: CS1061: 'MvcMiniProfiler.MiniProfiler' does not contain a definition for 'Step' and no extension method 'Step' accepting a first argument of type 'MvcMiniProfiler.MiniProfiler' could be found

Everything else is working fine.

Has the Step method been replaced by something else ??

like image 990
Storm Avatar asked Dec 13 '11 12:12

Storm


1 Answers

'.Step is an extension method - it is designed this way so it has close to 0 performance impact when profiling is off.

You will need this at the top of your file.

using StackExchange.Profiling;

like image 68
Sam Saffron Avatar answered Sep 22 '22 23:09

Sam Saffron