I’ve been using the excellent MiniProfiler with asp.mvc and NHibernate 3.20GA, but started running into an error – “Unable to cast transparent proxy to type 'System.Data.SqlClient.SqlCommand'” when I tried to flush my session.
Thankfully some smart people had already come up with a fix (in the comments for the post above)… albeit one that requires making some changes to the source NHibernate. Rather than have to recompile NH to get the fix in, here is a version that works against a standard NHibernate build.