I'm sure you're not the only one confused. I've always been baffled at the complete lack of documentation for NHProf's best feature. The NHProf's page (
) doesn't have any mention that a version 2.0 even exists, let alone any mention of what new features version 2.0 has.
The only mention of production profiling I've been able to find is in a screenshot caption and, as far as I can see, there is no explanation anywhere of what this mysterious "production profiling" is or how you're supposed to use it.
Which is a shame because it's awesome.
It's been writen for Entity Framework Profiler but it works in the same way with NHProf. If there is a proper doc somewhere, I'd love to know about it.
What this blog post doesn't mention at all is how to restrict access to NHProf when production profiling is active. When you use production profiling, NHProf becomes accessible at
http://yoursite.com/profiler/profiler.html as a Silverlight application. By default, access is not restricted, which is obviously a massive security hole. I'm sure the NHProf guys have got something in there that let you restrict access. But since there's no doc, it's anyone's guess what it is and how you configure it.
What we've done for our sites is adding this to our web.config to restrict access to logged-in users belonging to our Admin role:
<!-- Only allow administrators to access NHibernate Profiler -->
<location path="profiler">
<system.webServer>
<security>
<authorization>
<remove users="*" roles="" verbs="" />
<add accessType="Allow" users="" roles="Admin" />
</authorization>
</security>
</system.webServer>
</location>
Good luck!
Mehdi