JosefNemec/Playnite · error · Exception

Cannot start emulator using this configuration.

Error message

Cannot start emulator using this configuration.

What it means

Thrown as a generic Exception when Start(GameAction, bool, OnGameStartingEventArgs) receives a GameAction whose Type is GameActionType.Emulator. This overload explicitly does NOT handle emulator-type actions; emulator games must be started through the dedicated emulator start path (Start with an emulator-specific game action configuration). Passing an emulator action here is a misuse of the API.

Source

Thrown at source/Playnite/Controllers/GenericGameController.cs:490

            };

            Start(action, true, new OnGameStartingEventArgs
            {
                SourceAction = action,
                Game = Game
            });
        }

        public void Start(GameAction playAction, bool asyncExec, OnGameStartingEventArgs startingArgs)
        {
            if (playAction == null)
            {
                throw new ArgumentNullException("Cannot start game without play action.");
            }

            if (playAction.Type == GameActionType.Emulator)
            {
                throw new Exception("Cannot start emulator using this configuration.");
            }

            StartingArgs = startingArgs;
            var gameClone = Game.GetClone();
            var action = playAction.GetClone();
            action = action.ExpandVariables(gameClone);
            action.Path = CheckPath(action.Path, nameof(action.Path), FileSystemItem.File);
            action.WorkingDir = CheckPath(action.WorkingDir, nameof(action.WorkingDir), FileSystemItem.Directory);

            if (playAction.Type == GameActionType.Script)
            {
                if (action.Script.IsNullOrWhiteSpace())
                {
                    throw new ArgumentNullException("Game script is not defined.");
                }

                action.Script = Game.ExpandVariables(action.Script, false);
                RunStartScript(

View on GitHub (pinned to 5911f4e964)

Solutions

  1. Route emulator-type actions to the emulator start path: check action.Type == GameActionType.Emulator and call the emulator-specific StartEmulator method instead.
  2. If building a plugin, use PlayniteApi.StartGame or the appropriate GameController method that handles all action types.
  3. Audit the game's action configuration: if it should be a non-emulator game, change the action type to File, URL, or Script.
  4. Review the calling code to ensure it dispatches by action type before calling Start.

Example fix

// before — all actions funneled through the non-emulator Start
var action = game.PlayAction;
controller.Start(action, true, startingArgs); // throws if Type == Emulator

// after — dispatch by action type
if (action.Type == GameActionType.Emulator)
{
    controller.StartEmulator(action, emuProfile, romPath, true);
}
else
{
    controller.Start(action, true, startingArgs);
}
Defensive patterns

Strategy: validation

Validate before calling

if (action?.Type == GameActionType.Emulator)
{
    logger.Error("Use the emulator-specific Start method for emulator actions.");
    throw new InvalidOperationException("Emulator actions must use StartEmulator, not Start.");
}

Type guard

static bool RequiresEmulatorStartPath(GameAction action)
{
    return action != null && action.Type == GameActionType.Emulator;
}

Prevention

When it happens

Trigger: A game's play action has Type=GameActionType.Emulator but the caller invoked the non-emulator Start overload instead of the emulator-specific Start path. This can happen when a plugin routes all game starts through a single code path without checking action type.

Common situations: A custom extension or script calls GenericGameController.Start without first dispatching emulator-type actions to the emulator code path. A game was configured as an emulator game but the launch routing logic is broken. A refactoring merged two Start overloads incorrectly.

Related errors


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