{"record":{"id":"b056117f2ea0cb28","repo":"JosefNemec/Playnite","slug":"can-t-find-built-in-builtin-builtinprofilename-e","errorCode":null,"errorMessage":"Can't find built-in {builtIn.BuiltInProfileName} emulator profile.","messagePattern":"Can't find built-in (.+?) emulator profile\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"source/Playnite/Controllers/GenericGameController.cs","lineNumber":157,"sourceCode":"                    {\r\n                        startupArgs = expandedProfile.Arguments;\r\n                        if (!action.AdditionalArguments.IsNullOrEmpty())\r\n                        {\r\n                            startupArgs += \" \" + Game.ExpandVariables(action.AdditionalArguments, false, emulator.InstallDir, romPath);\r\n                        }\r\n                    }\r\n\r\n                    startupDir = expandedProfile.WorkingDirectory;\r\n                    startupPath = expandedProfile.Executable;\r\n                    StartEmulatorProcess(startupPath, startupArgs, startupDir, emulator.InstallDir, romPath, asyncExec, emulator.GetClone(), expandedProfile.GetClone(), expandedProfile.TrackingMode, expandedProfile.TrackingPath);\r\n                }\r\n            }\r\n            else if (currentEmuProfile is BuiltInEmulatorProfile builtIn)\r\n            {\r\n                var profileDef = Emulation.GetProfile(emulator.BuiltInConfigId, builtIn.BuiltInProfileName);\r\n                if (profileDef == null)\r\n                {\r\n                    throw new Exception($\"Can't find built-in {builtIn.BuiltInProfileName} emulator profile.\");\r\n                }\r\n\r\n                if (profileDef.ScriptStartup)\r\n                {\r\n                    var def = Emulation.GetDefition(emulator.BuiltInConfigId);\r\n                    if (def == null || !FileSystem.FileExists(Emulation.GetStartupScriptPath(def)))\r\n                    {\r\n                        throw new FileNotFoundException(ResourceProvider.GetString(LOC.ErrorEmulatorStartupScriptNotFound));\r\n                    }\r\n\r\n                    RunStartScriptFile(\r\n                        $\"{emulator.Name} runtime for {Game.Name}\",\r\n                        Emulation.GetStartupScriptPath(def),\r\n                        emulator.InstallDir,\r\n                        new Dictionary<string, object>\r\n                        {\r\n                            { \"Emulator\", emulator.GetClone() },\r\n                            { \"EmulatorProfile\", profileDef.GetClone() },\r","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/JosefNemec/Playnite/blob/5911f4e964e628aa7a69c2030ab35101afa63067/source/Playnite/Controllers/GenericGameController.cs#L139-L175","documentation":"Thrown by GenericGameController.StartEmulator (the BuiltInEmulatorProfile branch) when Emulation.GetProfile(emulator.BuiltInConfigId, builtIn.BuiltInProfileName) returns null — the named built-in profile is not registered for that emulator's built-in config. Bare Exception with the offending profile name interpolated.","triggerScenarios":"A BuiltInEmulatorProfile referencing a profile name that no longer exists in the built-in definitions; BuiltInConfigId changed/removed; profile renamed between Playnite versions; emulator's built-in definitions failed to load.","commonSituations":"Playnite upgraded and a built-in profile was renamed/removed; emulator add-on providing the built-in config was disabled/uninstalled; stale BuiltInProfileName stored on the action.","solutions":["Verify Emulation.GetProfile(id, name) returns non-null before launching (or that the profile is listed).","Update the game action to a currently-available built-in profile.","Ensure the emulator add-on supplying the built-in config is enabled and up to date.","Restart/reload Playnite so built-in definitions are reloaded."],"exampleFix":"// before\ncurrentEmuProfile = builtIn;\ncontroller.StartEmulator(action, asyncExec, args);\n\n// after — confirm the built-in profile exists\nif (Emulation.GetProfile(emulator.BuiltInConfigId, builtIn.BuiltInProfileName) == null)\n{\n    dialogs.ShowMessage($\"Built-in profile '{builtIn.BuiltInProfileName}' is unavailable. Re-select it.\");\n    return;\n}\ncurrentEmuProfile = builtIn;\ncontroller.StartEmulator(action, asyncExec, args);","handlingStrategy":"validation","validationCode":"if (Emulation.GetProfile(emulator.BuiltInConfigId, builtIn.BuiltInProfileName) == null) throw new InvalidOperationException($\"Profile {builtIn.BuiltInProfileName} missing\");","typeGuard":"static bool BuiltInProfileExists(Emulator e, BuiltInEmulatorProfile b) => Emulation.GetProfile(e.BuiltInConfigId, b.BuiltInProfileName) != null;","tryCatchPattern":"try { controller.StartEmulator(action, asyncExec, args); }\ncatch (Exception ex) when (Emulation.GetProfile(emulator.BuiltInConfigId, builtIn.BuiltInProfileName) == null) { dialogs.ShowMessage(\"Built-in profile unavailable. Re-select it.\"); }","preventionTips":["Confirm the built-in profile is still registered before launching.","Keep the emulator add-on that supplies built-in definitions enabled.","Re-select profiles after upgrades that rename/remove them."],"tags":["emulator","built-in-profile","validation","game-controller","playnite"],"backgroundTag":null,"analyzedSha":"5911f4e964e628aa7a69c2030ab35101afa63067","analyzedAt":"2026-08-13T17:38:25.713Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}