{"record":{"id":"459a3324a5058fa4","repo":"beeradmoore/dlss-swapper","slug":"librarypage-zipdidnotcontainanydlls","errorCode":null,"errorMessage":"LibraryPage_ZipDidNotContainAnyDlls","messagePattern":"LibraryPage_ZipDidNotContainAnyDlls","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Pages/LibraryPageModel.cs","lineNumber":702,"sourceCode":"                                {\n                                    ++totalDllsProcessed;\n                                    App.CurrentApp.RunOnUIThread(() =>\n                                    {\n                                        progressRun.Text = totalDllsProcessed.ToString(CultureInfo.CurrentCulture);\n                                    });\n                                    continue;\n                                }\n                            }\n                        }\n\n\n                        // Now that we know the zip itself is not a known zip we will extract each DLL and import them.\n                        using (var archive = ZipFile.OpenRead(importFile))\n                        {\n                            var zippedDlls = archive.Entries.Where(x => x.Name.EndsWith(\".dll\")).ToArray();\n                            if (zippedDlls.Length == 0)\n                            {\n                                throw new Exception(ResourceHelper.GetString(\"LibraryPage_ZipDidNotContainAnyDlls\"));\n                            }\n\n                            var dllsInZip = zippedDlls.Length;\n                            var processedDllsInZip = 0;\n\n                            App.CurrentApp.RunOnUIThread(() =>\n                            {\n                                dllInZipProgressBar.IsIndeterminate = false;\n                                dllInZipProgressBar.Value = processedDllsInZip;\n                                dllInZipProgressBar.Maximum = dllsInZip;\n                            });\n\n                            foreach (var zippedDll in zippedDlls)\n                            {\n                                var tempFile = Path.Combine(tempExtractPath, Guid.NewGuid().ToString(\"D\"), zippedDll.Name);\n                                Storage.CreateDirectoryForFileIfNotExists(tempFile);\n\n                                zippedDll.ExtractToFile(tempFile, true);","sourceCodeStart":684,"sourceCodeEnd":720,"githubUrl":"https://github.com/beeradmoore/dlss-swapper/blob/ab9b1e2d4bb04187c48fe58eeea06c2b0ea71fbb/src/Pages/LibraryPageModel.cs#L684-L720","documentation":"LibraryPageModel.ImportAsync opens the selected zip and filters its entries for .dll files; if the archive contains no DLLs at all, importing cannot proceed and it throws a localized 'zip did not contain any DLLs' error. This is a validation of zip contents before extraction.","triggerScenarios":"Calling ImportAsync with a zip file that passes the known-zip checks but whose entries include no file ending in .dll (case-sensitive check on x.Name).","commonSituations":"User picks a zip of documentation/config files instead of a mod archive; mod packaged with DLLs in a nested folder but renamed (.dl_ , .DLL handled only if extension matches casing via EndsWith on '.dll'); wrong archive downloaded.","solutions":["Open the zip and confirm it actually contains .dll files at any depth before importing.","Repackage the zip so it includes the required DLL files.","Check file extensions and casing — rename files so they end in '.dll' if they were altered.","Import the DLLs directly (not zipped) if the archive is not a valid mod package."],"exampleFix":"// before: import a zip with no DLLs -> error\n// after: pre-check in caller\nusing var archive = ZipFile.OpenRead(importFile);\nif (!archive.Entries.Any(e => e.Name.EndsWith(\".dll\", StringComparison.OrdinalIgnoreCase)))\n    throw new InvalidOperationException(\"Zip contains no DLLs; cannot import.\");","handlingStrategy":"validation","validationCode":"using var archive = ZipFile.OpenRead(importFile);\nbool hasDlls = archive.Entries.Any(e => e.Name.EndsWith(\".dll\", StringComparison.OrdinalIgnoreCase));\nif (!hasDlls) throw new InvalidOperationException(\"Zip contains no .dll files.\");","typeGuard":null,"tryCatchPattern":"try { await libraryPage.ImportAsync(zipPath); }\ncatch (Exception ex) when (ex.Message.Contains(\"ZipDidNotContainAnyDlls\"))\n{ NotifyUser(\"The selected zip contains no DLL files to import.\"); }","preventionTips":["Peek into the zip contents in the file picker before accepting it.","Ensure mods are packaged with DLLs at the archive root or any subfolder with '.dll' extensions intact.","Avoid renaming DLL extensions during packaging or download.","Document the expected zip layout for mod authors."],"tags":["zip","import","validation","dll"],"backgroundTag":"empty-result-set","analyzedSha":"ab9b1e2d4bb04187c48fe58eeea06c2b0ea71fbb","analyzedAt":"2026-09-15T05:25:32.979Z","contentChangedAt":"2026-09-15T05:25:32.979Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}