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
Instead of renewing the lock manualy, when you create the client subscription, try auto renewing it using the client's OnMessageOptions() like this:
OnMessageOptions options = new OnMessageOptions();
options.AutoRenewTimeout = TimeSpan.FromMinutes(1);
try
{
client = Subscription.CreateClient();
client.OnMessageAsync(MessageReceivedComplete, options);
}
catch (Exception ex)
{
throw new Exception (ex);
}