{"record":{"id":"f73293cbcd9a055c","repo":"beeradmoore/dlss-swapper","slug":"gamepage-dllpicker-couldnotfindfiletemplate","errorCode":null,"errorMessage":"GamePage_DllPicker_CouldNotFindFileTemplate","messagePattern":"GamePage_DllPicker_CouldNotFindFileTemplate","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/UserControls/DLLPickerControlModel.cs","lineNumber":321,"sourceCode":"            return;\n        }\n\n        try\n        {\n            if (File.Exists(CurrentGameAsset.Path))\n            {\n                Process.Start(\"explorer.exe\", $\"/select,{CurrentGameAsset.Path}\");\n            }\n            else\n            {\n                var dllPath = Path.GetDirectoryName(CurrentGameAsset.Path) ?? string.Empty;\n                if (Directory.Exists(dllPath))\n                {\n                    Process.Start(\"explorer.exe\", dllPath);\n                }\n                else\n                {\n                    throw new Exception(ResourceHelper.GetFormattedResourceTemplate(\"GamePage_DllPicker_CouldNotFindFileTemplate\", CurrentGameAsset.Path));\n                }\n            }\n        }\n        catch (Exception err)\n        {\n            Logger.Error(err);\n            ShowTempInfoBar(ResourceHelper.GetString(\"General_Error\"), err.Message, severity: InfoBarSeverity.Error);\n        }\n    }\n\n    [RelayCommand]\n    async Task ResetDllAsync()\n    {\n        var didReset = await Game.ResetDllAsync(GameAssetType);\n\n        if (didReset.Success == true)\n        {\n            if (_parentDialogWeakReference.TryGetTarget(out var parentDialog) == true)","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/beeradmoore/dlss-swapper/blob/ab9b1e2d4bb04187c48fe58eeea06c2b0ea71fbb/src/UserControls/DLLPickerControlModel.cs#L303-L339","documentation":"DLLPickerControlModel.OpenDllPath tries to open the folder containing the game asset's DLL in Windows Explorer; when the resolved dllPath directory does not exist it throws a localized 'could not find file' exception formatted with the asset path. It signals the DLL file/folder recorded for the game is gone from disk.","triggerScenarios":"Calling OpenDllPath for a game asset whose CurrentGameAsset.Path points to a directory (or file whose folder) that no longer exists — the else branch after Directory.Exists(dllPath) fails.","commonSituations":"The game or mod was uninstalled/moved after being added to the library; path stored with a different drive letter or profile; OneDrive/cloud folder moved; user deleted the mod folder manually.","solutions":["Verify the path exists on disk; reinstall or relocate the game/mod so the DLL folder is present.","Re-select or re-import the DLL in the Library/Game page so the stored path is updated to the current location.","Edit the game asset entry to correct the stale Path value.","Check drive letters/mounts — the path may reference a drive that isn't currently connected."],"exampleFix":"// before: stale stored path\nawait model.OpenDllPath(); // throws if folder was moved\n// after: verify and refresh first\nif (!Directory.Exists(Path.GetDirectoryName(CurrentGameAsset.Path)))\n    await ReImportDllAsync(CurrentGameAsset); // refresh stored path\nelse\n    await model.OpenDllPath();","handlingStrategy":"validation","validationCode":"var dir = Path.GetDirectoryName(CurrentGameAsset.Path);\nbool canOpen = Directory.Exists(dir);\nif (canOpen) Process.Start(\"explorer.exe\", dir);","typeGuard":"static bool DllPathExists(string path) => !string.IsNullOrWhiteSpace(path) && Directory.Exists(Path.GetDirectoryName(path));","tryCatchPattern":"try { await picker.OpenDllPath(); }\ncatch (Exception ex) when (ex.Message.Contains(\"CouldNotFindFile\"))\n{ Logger.Error(ex); PromptReImportDll(CurrentGameAsset); }","preventionTips":["Periodically verify stored asset paths still exist and flag stale entries in the UI.","Offer a re-import/re-locate flow instead of failing when a path is missing.","Resolve full paths at import time and store them, not relative or UNC guesses.","Watch for moved game libraries and update stored paths on game rescans."],"tags":["file-system","path","explorer","not-found"],"backgroundTag":"file-not-found","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"}