I want to disable profiling and also mini-profiler-resources/results, mini-profiler-resources/results-list endpoints depending on some boolean flag. I know that i can skip starting profiler for the request but still endpoints to results are available (exception is thrown but they exist).
Ok so I analyzed code and I can answer to my own question. Mini profiler is registered as IRouteHandler
and IHttpHandler
. If you'll use any method from mini profiler it will initialize this module by firing ctor of WebRequestProfilerProvider
. So if you want to disable mini profiler and all routes (mini-profiler-resources/results, mini-profiler-resources/results-index) make sure that you don't fire any mini profile method including: