This project is read-only.

MiniProfiler and SqlAzure

Topics: Troubleshooting
Jul 3, 2014 at 4:38 AM
Since was fixed, the ability to use MiniProfiler on Azure has been lost. If you attempt to enable it you will encounter the following error.

NHibernate.Util.ADOExceptionReporter - Unable to cast object of type 'NHibernate.SqlAzure.ReliableSqlCommand' to type 'System.Data.Common.DbCommand'.

And you will need to make the changes manually in your database to turn off the feature.

I'd like to solve this, just need some direction.
Jul 3, 2014 at 7:31 PM
ReliableSqlCommand is indeed not a child of DbCommand so no surprise, but really nothing should depend on the command object being castable to DbCommand (but rather IDbCommand). Where is the exception coming from exactly? What happens if you chance the cast to IDbCommand, what ReliableSqlCommand implements?