I\'m using a Microsoft azure service bus queue to process calculations and my program runs fine for a few hours but then I start to get this exception for every message that
I spent hours trying understand why I was getting a MessageLockLostException. The reason for me was due to AutoComplete defaulting to true.
If you're going to call messsage.Complete() (or CompleteAsync()) then you should instantiate an OnMessageOptions object, set AutoComplete to false, and pass it into your OnMessage call.
var options = new OnMessageOptions();
options.AutoComplete = false;
client.OnMessage(processCalculations, options);