beeradmoore/dlss-swapper · error · Exception

LibraryPage_ZipDidNotContainAnyDlls

Error message

LibraryPage_ZipDidNotContainAnyDlls

What it means

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.

Solutions

  1. Open the zip and confirm it actually contains .dll files at any depth before importing.
  2. Repackage the zip so it includes the required DLL files.
  3. Check file extensions and casing — rename files so they end in '.dll' if they were altered.
  4. Import the DLLs directly (not zipped) if the archive is not a valid mod package.

Example fix

// before: import a zip with no DLLs -> error
// after: pre-check in caller
using var archive = ZipFile.OpenRead(importFile);
if (!archive.Entries.Any(e => e.Name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)))
    throw new InvalidOperationException("Zip contains no DLLs; cannot import.");
Defensive patterns

Strategy: validation

Validate before calling

using var archive = ZipFile.OpenRead(importFile);
bool hasDlls = archive.Entries.Any(e => e.Name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase));
if (!hasDlls) throw new InvalidOperationException("Zip contains no .dll files.");

Try / catch

try { await libraryPage.ImportAsync(zipPath); }
catch (Exception ex) when (ex.Message.Contains("ZipDidNotContainAnyDlls"))
{ NotifyUser("The selected zip contains no DLL files to import."); }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of beeradmoore/dlss-swapper@ab9b1e2d4b (2026-09-15). Data as JSON: /api/errors/459a3324a5058fa4. Report an issue: GitHub.

Appendix: source

Thrown at src/Pages/LibraryPageModel.cs:702

                                {
                                    ++totalDllsProcessed;
                                    App.CurrentApp.RunOnUIThread(() =>
                                    {
                                        progressRun.Text = totalDllsProcessed.ToString(CultureInfo.CurrentCulture);
                                    });
                                    continue;
                                }
                            }
                        }


                        // Now that we know the zip itself is not a known zip we will extract each DLL and import them.
                        using (var archive = ZipFile.OpenRead(importFile))
                        {
                            var zippedDlls = archive.Entries.Where(x => x.Name.EndsWith(".dll")).ToArray();
                            if (zippedDlls.Length == 0)
                            {
                                throw new Exception(ResourceHelper.GetString("LibraryPage_ZipDidNotContainAnyDlls"));
                            }

                            var dllsInZip = zippedDlls.Length;
                            var processedDllsInZip = 0;

                            App.CurrentApp.RunOnUIThread(() =>
                            {
                                dllInZipProgressBar.IsIndeterminate = false;
                                dllInZipProgressBar.Value = processedDllsInZip;
                                dllInZipProgressBar.Maximum = dllsInZip;
                            });

                            foreach (var zippedDll in zippedDlls)
                            {
                                var tempFile = Path.Combine(tempExtractPath, Guid.NewGuid().ToString("D"), zippedDll.Name);
                                Storage.CreateDirectoryForFileIfNotExists(tempFile);

                                zippedDll.ExtractToFile(tempFile, true);

View on GitHub (pinned to ab9b1e2d4b)