Run Hidden without Turning Off


#1

I would like to be able to run MP, but keep it hidden, in order to log a bunch of profiling information from various users, so that we can get a representative sample of usage without being in the users’ faces.

I know about being to start/stop MP based on users and roles, but I was more interested in the heads-up display itself. Can it be hidden without turning off MP?

-T


#2

As it says on MiniProfiler.com, you can restrict who will see the UI:

protected void Application_Start(object sender, EventArgs e) 
{
   MiniProfiler.Settings.Results_Authorize = IsUserAllowedToSeeMiniProfilerUI;
}
private bool IsUserAllowedToSeeMiniProfilerUI(HttpRequest httpRequest)
{
    // Implement your own logic for who 
    // should be able to access ~/mini-profiler-resources/results
    var principal = httpRequest.RequestContext.HttpContext.User;
    return principal.IsInRole("Developer");   
}

If you dont want to show the UI at all - just dont put in the code in your VIew to render the UI. Rendering the UI has nothing to do with storing results.