beeradmoore/dlss-swapper · error · Exception

GamePage_CouldNotFindGameInstallPathTemplate

Error message

GamePage_CouldNotFindGameInstallPathTemplate

What it means

MultipleDLLsFoundControlModel.OpenDLLPath opens the folder of the selected DLL in Windows Explorer; when the directory derived from gameAsset.Path does not exist it throws a localized 'could not find game install path' exception formatted with the asset's path. It means the DLL recorded for the game is no longer at the stored location.

Solutions

  1. Confirm the DLL's folder exists; reinstall or move the mod back to the recorded path.
  2. Re-import the DLLs so gameAsset.Path is updated to the current location.
  3. Remove the stale asset entry and re-add the game/mod.
  4. Check drive letters and network/cloud folder availability for the stored path.

Example fix

// before: stale asset path
model.OpenDLLPath(); // throws
// after: refresh before opening
if (!Directory.Exists(Path.GetDirectoryName(gameAsset.Path)))
    await RefreshGameAssetPathAsync(gameAsset);
else
    model.OpenDLLPath();
Defensive patterns

Strategy: validation

Validate before calling

var dir = Path.GetDirectoryName(gameAsset.Path);
if (!Directory.Exists(dir))
    throw new DirectoryNotFoundException($"DLL folder not found: {dir}");

Type guard

static bool AssetPathExists(GameAsset a) => !string.IsNullOrWhiteSpace(a.Path) && Directory.Exists(Path.GetDirectoryName(a.Path));

Try / catch

try { multiDllDialog.OpenDLLPath(); }
catch (Exception ex) when (ex.Message.Contains("CouldNotFindGameInstallPath"))
{ Logger.Error(ex); MarkAssetStale(gameAsset); }

Prevention

When it happens

Trigger: Calling OpenDLLPath from the multiple-DLLs-found dialog when Directory.Exists(dllPath) is false for the chosen gameAsset.Path — the DLL folder was deleted, moved, or the path was persisted incorrectly.

Common situations: Mod folder deleted or renamed after import; game moved between library folders; path references a disconnected drive; duplicate/stale asset entries pointing at old locations.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at src/UserControls/MultipleDLLsFoundControlModel.cs:42

    [RelayCommand]
    void OpenDLLPath(GameAsset gameAsset)
    {
        try
        {
            if (File.Exists(gameAsset.Path))
            {
                Process.Start("explorer.exe", $"/select,{gameAsset.Path}");
            }
            else
            {
                var dllPath = Path.GetDirectoryName(gameAsset.Path) ?? string.Empty;
                if (Directory.Exists(dllPath))
                {
                    Process.Start("explorer.exe", dllPath);
                }
                else
                {
                    throw new Exception(ResourceHelper.GetFormattedResourceTemplate("GamePage_CouldNotFindGameInstallPathTemplate", gameAsset.Path));
                }
            }
        }
        catch (Exception err)
        {
            Logger.Error(err);
        }
    }
}

View on GitHub (pinned to ab9b1e2d4b)