{"record":{"id":"afca18c2030c9a76","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"canonicalname-is-not-a-recognized-or-allowed-app","errorCode":null,"errorMessage":"{canonicalName} is not a recognized or allowed app name","messagePattern":"(.+?) is not a recognized or allowed app name","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"source/OculusHelper/OculusManager.cs","lineNumber":139,"sourceCode":"                    }\n                }\n            }\n\n            return apps;\n        }\n\n        public static void RemoveApp(string canonicalName)\n        {\n            Console.WriteLine(\"Looking for apps with canonical name: \" + canonicalName);\n\n            var apps = QueryOculusApps()\n                .Where(x => canonicalName.Equals(x.CanonicalName, StringComparison.OrdinalIgnoreCase))\n                .ToList();\n\n            if (apps.Count == 0)\n            {\n                Console.WriteLine(\"Invalid app name or app can't be uninstalled\");\n                throw new Exception($\"{canonicalName} is not a recognized or allowed app name\");\n            }\n\n            foreach (var app in apps)\n                RemoveApp(app);\n        }\n\n        public static void RemoveApp(OculusApp app)\n        {\n            CloseOculusClient();\n\n            Console.WriteLine(\"Removing Oculus app: \" + app.CanonicalName);\n            Debug.Assert(app.CanonicalName.Length > 10);\n\n            foreach (var libraryLocation in OculusLibraryLocations)\n            {\n                // Collect paths first to avoid crashing halfway\n                var dirs = Directory.GetDirectories(libraryLocation,\n                    $\"*{app.CanonicalName}*\", SearchOption.AllDirectories);","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/OculusHelper/OculusManager.cs#L121-L157","documentation":"Thrown by OculusManager.RemoveApp(string) when QueryOculusApps returns zero apps whose CanonicalName matches the argument (case-insensitive). It is a plain System.Exception (no dedicated type), surfaced as 'not a recognized or allowed app name'. The check fires after enumerating installed Oculus titles from the Oculus library JSON, so a miss means either the name is wrong or the app is not installed/tracked.","triggerScenarios":"Calling RemoveApp(canonicalName) where canonicalName does not match any installed app's CanonicalName; the Oculus software library is not installed so QueryOculusApps returns nothing; the install location was moved so Directory.Exists checks inside QueryOculusApps filtered the app out.","commonSituations":"Hardcoding a canonical name that changed between Oculus versions; uninstalling an app that was already removed; running on a machine without the Oculus software; the Oculus library JSON being empty or in a new format.","solutions":["Call QueryOculusApps() first and confirm the canonical name exists in the returned list before calling RemoveApp.","List installed apps (their CanonicalName values) for the user to pick from rather than guessing the string.","Verify the Oculus software and library are installed on the machine before attempting removal.","Treat a zero-match result as a no-op/success in your own orchestrator if 'remove if present' semantics are acceptable."],"exampleFix":"// before\nOculusManager.RemoveApp(nameFromConfig);\n\n// after\nvar installed = OculusManager.QueryOculusApps();\nif (installed.Any(a => a.CanonicalName.Equals(nameFromConfig, StringComparison.OrdinalIgnoreCase)))\n    OculusManager.RemoveApp(nameFromConfig);\nelse\n    Console.WriteLine($\"{nameFromConfig} is not installed, skipping\");","handlingStrategy":"validation","validationCode":"var installed = OculusManager.QueryOculusApps();\nvar match = installed.FirstOrDefault(a =>\n    a.CanonicalName.Equals(canonicalName, StringComparison.OrdinalIgnoreCase));\nif (match == null) return; // not installed; nothing to remove","typeGuard":"static bool IsInstalledOculusApp(string canonicalName) =>\n    OculusManager.QueryOculusApps().Any(a =>\n        a.CanonicalName.Equals(canonicalName, StringComparison.OrdinalIgnoreCase));","tryCatchPattern":"try { OculusManager.RemoveApp(canonicalName); }\ncatch (Exception ex) when (ex.Message.Contains(\"not a recognized\"))\n{ /* treat as already removed / not present */ }","preventionTips":["Enumerate installed apps and let the user pick rather than hardcoding a name.","Verify the Oculus software/library is installed before attempting removal.","Treat zero-match as a no-op in uninstall orchestrators."],"tags":["oculus","uninstall","validation","csharp"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}