public static async Task <string> ExportTempFileAsync(this UniversalPackageFile file)
        {
            var tempDir  = CreateTempDirectory();
            var fileName = await ExportTempFileAsync(tempDir, file);

            AppDomain.CurrentDomain.DomainUnload += (s, _e) =>
            {
                try
                {
                    Directory.Delete(tempDir, true);
                }
                catch
                {
                }
            };
            return(fileName);
        }
        private static async Task <string> ExportTempFileAsync(string basePath, UniversalPackageFile file)
        {
            var fullName = Path.Combine(basePath, file.Name);

            if (file.Children == null)
            {
                using (var stream = new FileStream(fullName, FileMode.Create, FileAccess.Write, FileShare.None, 4096, FileOptions.Asynchronous | FileOptions.SequentialScan))
                {
                    await file.CopyToAsync(stream);
                }
            }
            else
            {
                Directory.CreateDirectory(fullName);
                foreach (var child in file.Children)
                {
                    await ExportTempFileAsync(fullName, child);
                }
            }

            return(fullName);
        }