ExcludeMethod in MVC


#1

Is there something special I need to do to exclude a method from the profiler? I tried:

MiniProfiler.Settings.ExcludeMethod(“area/controllerName/action”);

This was added to the application_BeginRequest

I tried just the action name too, but that didn’t seem to work.


#2

Exclude method is used to leave out that method from the Stack Trace output (and you should call it in your Init for MiniProfiler that would get called in Application_Start - see the Sample.MVC project for how this is done).

I think that you are probably interested in doing:

using (MiniProfiler.Current.Ignore()) {
  // code that you dont want to profile
}

#3

Yes, I did realize I had it in the wrong spot and put them in app_start, but I still didn’t get it to work. I also tried your idea, and I still get it listed.

What I am trying to do is to have certain controller actions ignored by the profiler.

Thanks