protected override PackageSendEventArgs OnSend(ProgressMonitorStack progressMonitors) { int fileSizeBytes = 0; AsyncTaskResult result; string statusMessage; Exception taskException = null; try { //all we do is save the file out to our target path. Package.Save(progressMonitors, FileNamePath); // Uh-oh, we have to save it again! result = AsyncTaskResult.Success; fileSizeBytes = (int)FileSystemTools.GetFileSize(FileNamePath); statusMessage = string.Format(CultureInfo.CurrentCulture, "Package written to file {0}", Path.GetFileNameWithoutExtension(FileNamePath)); } catch (Exception ex) { result = AsyncTaskResult.Error; statusMessage = "Unable to save the package to disk.\r\n\r\nIt's possible that you don't have sufficient access to the directory to write the file or the media is read-only."; taskException = ex; } return(new PackageSendEventArgs(fileSizeBytes, result, statusMessage, taskException)); }