C# BackgroundWorker_DoWork only does some of the work
This one has me stumped.  I have a simple utility I made to help with an enterprise installation of software.  One component backs up AppData files the user currently has on their machine and saves them to a folder on the desktop:

        private void backupButton_Click(object sender, EventArgs e)
        {
            backgroundBackup.RunWorkerAsync();
        }


        private void backgroundBackup_DoWork(object sender, DoWorkEventArgs e)
        {
            String appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            String desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            String backupPath = desktopPath + @"\Backup";
            String toolsBackupPath = desktopPath + @"\Backup\Data\";
            String toolsPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Software\Folder\Folder\";

            DirectoryInfo appDataPathMI = new DirectoryInfo(appDataPath + @"\Software\Folder\");
            DirectoryInfo backupPathDI = new DirectoryInfo(backupPath);
            DirectoryInfo toolsPathDI = new DirectoryInfo(toolsPath);
            DirectoryInfo toolsBackupPathDI = new DirectoryInfo(toolsBackupPath);


            if (!Directory.Exists(backupPath))
            {
                DirectoryInfo di = Directory.CreateDirectory(desktopPath + @"\Backup\");
            }


            if (!Directory.Exists(toolsBackupPath))
            {
                DirectoryInfo di = Directory.CreateDirectory(desktopPath + @"\Backup\Data\");
            }
            
            try
            {
                CopyAll(appDataPathMI, backupPathDI);
            }

            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }
            
            try
            {
                CopyAll(toolsPathDI, toolsBackupPathDI);
            }

            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }
        }

        private static void CopyAll(DirectoryInfo source, DirectoryInfo target)
        {
            if (Directory.Exists(target.FullName) == false)
            {
                Directory.CreateDirectory(target.FullName);
            }

            foreach (FileInfo fi in source.GetFiles())
            {
                fi.CopyTo(Path.Combine(target.ToString(), fi.Name), true);
            }

            foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
            {
                DirectoryInfo nextTargetSubDir = target.CreateSubdirectory(diSourceSubDir.Name);
                CopyAll(diSourceSubDir, nextTargetSubDir);
            }
        }

This works, but does not produce the expected results.  I put this operation on a background thread because the total file size each user is backing up may approach a gb or two.  Each time this is run, some, but not all of the files and folders from the target are copied to the destination, and the folders that are copied varies each time.  Sometimes only a handful of files and folders are copied, sometimes almost all everything is copied, but never the entire target.  If this operation is placed in a simple console app, it works every time.  Is there anything I need to understand about the BackgroundWorker class that is causing it to not do all the work in the DoWork method?
C# BackgroundWorker_DoWork only does some of the work
===

This one has me stumped.  I have a simple utility I made to help with an enterprise installation of software.  One component backs up AppData files the user currently has on their machine and saves them to a folder on the desktop:

        private void backupButton_Click(object sender, EventArgs e)
        {
            backgroundBackup.RunWorkerAsync();
        }


        private void backgroundBackup_DoWork(object sender, DoWorkEventArgs e)
        {
            String appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            String desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            String backupPath = desktopPath + @"\Backup";
            String toolsBackupPath = desktopPath + @"\Backup\Data\";
            String toolsPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Software\Folder\Folder\";

            DirectoryInfo appDataPathMI = new DirectoryInfo(appDataPath + @"\Software\Folder\");
            DirectoryInfo backupPathDI = new DirectoryInfo(backupPath);
            DirectoryInfo toolsPathDI = new DirectoryInfo(toolsPath);
            DirectoryInfo toolsBackupPathDI = new DirectoryInfo(toolsBackupPath);


            if (!Directory.Exists(backupPath))
            {
                DirectoryInfo di = Directory.CreateDirectory(desktopPath + @"\Backup\");
            }


            if (!Directory.Exists(toolsBackupPath))
            {
                DirectoryInfo di = Directory.CreateDirectory(desktopPath + @"\Backup\Data\");
            }
            
            try
            {
                CopyAll(appDataPathMI, backupPathDI);
            }

            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }
            
            try
            {
                CopyAll(toolsPathDI, toolsBackupPathDI);
            }

            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }
        }

        private static void CopyAll(DirectoryInfo source, DirectoryInfo target)
        {
            if (Directory.Exists(target.FullName) == false)
            {
                Directory.CreateDirectory(target.FullName);
            }

            foreach (FileInfo fi in source.GetFiles())
            {
                fi.CopyTo(Path.Combine(target.ToString(), fi.Name), true);
            }

            foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
            {
                DirectoryInfo nextTargetSubDir = target.CreateSubdirectory(diSourceSubDir.Name);
                CopyAll(diSourceSubDir, nextTargetSubDir);
            }
        }

This works, but does not produce the expected results.  I put this operation on a background thread because the total file size each user is backing up may approach a gb or two.  Each time this is run, some, but not all of the files and folders from the target are copied to the destination, and the folders that are copied varies each time.  Sometimes only a handful of files and folders are copied, sometimes almost all everything is copied, but never the entire target.  If this operation is placed in a simple console app, it works every time.  Is there anything I need to understand about the BackgroundWorker class that is causing it to not do all the work in the DoWork method?