RegisterRoutes shouldn't be called just because MiniProfiler.Current is

See subject. I don’t think this chain of calls makes a lot of sense.

We run MiniProfiler on our site, and don’t want it even spinning up on our production server, but do run it on our dev/staging servers.

We peppered our code with calls to MiniProfiler.Current (to trace specific methods) and found that calling that will force StackExchange.Profiling.UI.MiniProfilerHandler.RegisterRoutes to fire automagically.

I tend to agree on this, will ask Jarrod what he thinks

Thanks. It’s not a huge deal for other people, I think, but because of how our sites are structured/wired up, we run into locking issues/exceptions when the MiniProfiler tries to wire itself up “ad-hoc” this way.