Occasionally I have a need to retry an operation several times before giving up. My code is like:
int retries = 3;
while(true) {
try {
DoSomething();
The Transient Fault Handling Application Block provides an extensible collection of retry strategies including:
It also includes a collection of error detection strategies for cloud-based services.
For more information see this chapter of the Developer's Guide.
Available via NuGet (search for 'topaz').