public void Execute() { // This is where we are using the new downloader code try { if (_enableLogging) { var task = _parameters.DownloadAsync(_token, this, s => logger.Debug(s)); task.Wait(_token); } else { var task = _parameters.DownloadAsync(_token, this); task.Wait(_token); } } catch (OperationCanceledException e) { logger.DebugFormat("OperationCanceledException {0}", _fileName); logger.Error(e); } logger.DebugFormat("Execution Over with _token.IsCancellationRequested = {0} for {1}", _token.IsCancellationRequested, _fileName); }