The problem is caused by the fact that cmbDataSourceExtractor.CancelAsync()
is an asynchronous method, the Cancel
operation has not yet completed when cmdDataSourceExtractor.RunWorkerAsync(...)
exitst. You should wait for cmdDataSourceExtractor
to complete before calling RunWorkerAsync
again. How to do this is explained in this SO question.