JosefNemec/Playnite · error · Exception

Emulator {emulator.BuiltInConfigId} and profile {profile.Bui

Error message

Emulator {emulator.BuiltInConfigId} and profile {profile.BuiltInProfileName} not found.

What it means

Thrown when ScanDirectory is called with a BuiltInEmulatorProfile whose (emulator.BuiltInConfigId, profile.BuiltInProfileName) pair resolves to no EmulatorDefinitionProfile via Emulation.GetProfile. Unlike error 60, this path is reached when scanning is initiated directly with a profile object (the BuiltInEmulatorProfiles editor flow), so the emulator definition itself is the missing piece.

Source

Thrown at source/Playnite/Emulators/Scanner.cs:535

            return matches;
        }

        private List<ScannedGame> ScanDirectory(
            string directory,
            Emulator emulator,
            BuiltInEmulatorProfile profile,
            CancellationToken cancelToken,
            string crcExludePatterns,
            bool scanSubfolders,
            bool scanArchives,
            bool mergeRelatedFiles,
            Action<string> fileScanCallback = null)
        {
            var emuProf = Emulation.GetProfile(emulator.BuiltInConfigId, profile.BuiltInProfileName);
            if (emuProf == null)
            {
                throw new Exception($"Emulator {emulator.BuiltInConfigId} and profile {profile.BuiltInProfileName} not found.");
            }

            if (emuProf.ScriptGameImport)
            {
                object scannedGames = null;
                Exception failExc = null;
                var importRuntime = new PowerShellRuntime("Emu game import");
                var scriptTask = Task.Run(() =>
                {
                    try
                    {
                        scannedGames = importRuntime.ExecuteFile(
                            Emulation.GetGameImportScriptPath(Emulation.GetDefition(emulator.BuiltInConfigId)),
                            emulator.InstallDir,
                            new Dictionary<string, object>
                            {
                                { "CancelToken", cancelToken },
                                { "Emulator", emulator },

View on GitHub (pinned to 5911f4e964)

Solutions

  1. Confirm Emulation.GetDefinition(emulator.BuiltInConfigId) returns a definition with a Profile whose Name equals profile.BuiltInProfileName before scanning.
  2. Recreate the built-in profile so BuiltInProfileName aligns with the current definition.
  3. Validate that built-in emulator definition files shipped with Playnite are present and parseable.

Example fix

// before
var emuProf = Emulation.GetProfile(emulator.BuiltInConfigId, profile.BuiltInProfileName);
if (emuProf == null) { throw new Exception($"Emulator {emulator.BuiltInConfigId} and profile {profile.BuiltInProfileName} not found."); }

// after
var emuProf = Emulation.GetProfile(emulator.BuiltInConfigId, profile.BuiltInProfileName);
if (emuProf == null) {
    throw new Exception($"Emulator definition '{emulator.BuiltInConfigId}' has no profile named '{profile.BuiltInProfileName}'. Available: {string.Join(", ", Emulation.GetDefition(emulator.BuiltInConfigId)?.Profiles?.Select(p => p.Name) ?? Enumerable.Empty<string>())}");
}
Defensive patterns

Strategy: validation

Validate before calling

// Verify definition/profile pair resolves before scanning with a BuiltInEmulatorProfile.
if (Emulation.GetProfile(emulator.BuiltInConfigId, profile.BuiltInProfileName) == null) {
    logger.Warn($"No definition for {emulator.BuiltInConfigId}/{profile.BuiltInProfileName}");
    return;
}

Type guard

static bool BuiltInProfileResolves(Emulator emu, BuiltInEmulatorProfile p) =>
    Emulation.GetProfile(emu.BuiltInConfigId, p.BuiltInProfileName) != null;

Prevention

When it happens

Trigger: Calling the ScanDirectory overload taking BuiltInEmulatorProfile profile where Emulation.GetProfile(emulator.BuiltInConfigId, profile.BuiltInProfileName) returns null. The definition name on the profile does not match any profile in the loaded definition for that emulator id.

Common situations: Built-in emulator definitions were updated/renamed but a saved profile still references the old BuiltInProfileName; BuiltInConfigId is null because the emulator record was never assigned a built-in definition; definition files failed to deserialize at startup.

Related errors


AI-assisted analysis of JosefNemec/Playnite@5911f4e964 (2026-08-13). Data as JSON: /api/errors/bbda6618d51b0c3b. Report an issue: GitHub.