SQL Server Debugging: "Unable to Step. Invalid operation"

I'm debugging a call to a Stored Procedure in SSMS (2012). Frequently, and various random points in the code, a dialog pops up:

Microsoft SQL Server Management Studio:
Unable to Step. Invalid Operation.

Once I dismiss the dialog, it appears that debugging CAN continue... I can continue to step through the code to the end, without any apparent problems. So far....


I had the same problem. After some research I found this page which suggests that this is caused by a race condition. Although the workaround given there wasn't applicable for me, after stopping every other debugging processes (Visual Studio) these annoying error messages didn't display anymore.