Sql Dependency and SignalR: SqlDependency.Start() must be called prior ….

I got this error: “When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance” couple of hours ago and I decided to share.

This error occurs if you didn’t started your SqlDependency or it got closed for some reason.  I usually start it this way in the Global.asax

 protected void Application_Start(Object sender, EventArgs e)
   var sConn = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
   // Cache systemwide data in the application object.