My code looks in a directory for .zip files and extracts them to a temporary folder structure for deletion later.
Occasionally, I get the ContextSwitchDeadlock was detected
error and when I investigate where this is occurring, its during the unzipping of the zip files.
As a result, I'd like to move this into a background worker thread but can't for the life of me figure out where to start with background worker.
Any help would be much appreciated.
I guess I'm going to need to pass the list of zipfiles into the background worker thread but have had no success so far.
The first line of code where the zipfiles are unzipped is: foreach (FileInfo fz in ZipFiles) { does the unzipping stuff }
So I want to put this entire foreach loop in a background worker (i think?)