SqlDependency starts on application start and stops on app stop. There are can be cases when SqlDependency.Stop()
failed (for example, problem with connect to DB). As I understand, the SqlDependency infrastructure will be removed anyway by timeout.
But I don't understand what else SqlDependency.Stop() do?
Does it make sense to call SqlDependency.Stop() before SqlDependency.Start()?
If
Start()
was not called, callingStop()
is a no-op. We can check in the SqlDependency.cs reference sourceSo it doesn't hurt, but it shouldn't be needed.