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

**URL:** <https://community.miniprofiler.com/t/registerroutes-shouldnt-be-called-just-because-miniprofiler-current-is/86>\
**Category:** uncategorized\
**Created:** [July 30, 2012, 10:02pm UTC](https://community.miniprofiler.com/t/registerroutes-shouldnt-be-called-just-because-miniprofiler-current-is/86 "2012-07-30T22:02:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/nicholas/32/1018_2.png) [@Nicholas](https://community.miniprofiler.com/u/Nicholas)\
**Post date:** [July 30, 2012, 10:02pm UTC](https://community.miniprofiler.com/t/registerroutes-shouldnt-be-called-just-because-miniprofiler-current-is/86/1 "2012-07-30T22:02:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/sam/32/377_2.png) [@sam](https://community.miniprofiler.com/u/sam)\
**Post date:** [August 1, 2012, 3:05am UTC](https://community.miniprofiler.com/t/registerroutes-shouldnt-be-called-just-because-miniprofiler-current-is/86/2 "2012-08-01T03:05:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nicholas](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/nicholas/32/1018_2.png) [@Nicholas](https://community.miniprofiler.com/u/Nicholas)\
**Post date:** [August 5, 2012, 6:37pm UTC](https://community.miniprofiler.com/t/registerroutes-shouldnt-be-called-just-because-miniprofiler-current-is/86/3 "2012-08-05T18:37:36Z")

</div>

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.
