JosefNemec/Playnite · error · NotSupportedException

Uknown play action type.

Error message

Uknown play action type.

What it means

Thrown as NotSupportedException when a game's play controller is a GenericPlayController but the resolved playAction is none of EmulationPlayAction, AutomaticPlayController, or GameAction. It is an exhaustiveness guard: the startup dispatch does not know how to launch that action type through a generic controller.

Source

Thrown at source/Playnite/GamesEditor.cs:398

                }

                if (controller is GenericPlayController genCtrl)
                {
                    if (playAction is EmulationPlayAction emuAct)
                    {
                        genCtrl.StartEmulator(emuAct, true, startingArgs);
                    }
                    else if (playAction is AutomaticPlayController autoAction)
                    {
                        genCtrl.Start(autoAction);
                    }
                    else if (playAction is GameAction act)
                    {
                        genCtrl.Start(act, true, startingArgs);
                    }
                    else
                    {
                        throw new NotSupportedException("Uknown play action type.");
                    }
                }
                else
                {
                    controller.Play(new PlayActionArgs());
                }
            }
            catch (Exception exc) when (!PlayniteEnvironment.ThrowAllErrors)
            {
                logger.Error(exc, "Cannot start game: ");
                Dialogs.ShowMessage(
                    resources.GetString(LOC.GameStartError).Format(exc.Message), LOC.GameError,
                    MessageBoxButton.OK, MessageBoxImage.Error);
                if (controller != null)
                {
                    controllers.RemoveController(controller);
                    UpdateGameState(game.Id, null, null, null, null, false);
                }

View on GitHub (pinned to 5911f4e964)

Solutions

  1. Ensure the play action is one of the three supported types before invoking StartGame.
  2. Update Playnite/extension SDK to a version where the action type is recognized.
  3. For extension authors, return EmulationPlayAction/AutomaticPlayController/GameAction rather than custom types.

Example fix

// before
else { throw new NotSupportedException("Uknown play action type."); }

// after — log the actual type for diagnosis
else { throw new NotSupportedException($"Unsupported play action type '{playAction?.GetType().FullName}' for controller '{controller?.GetType().Name}'."); }
Defensive patterns

Strategy: type-guard

Validate before calling

// Confirm playAction is a supported type before starting.
if (!(playAction is EmulationPlayAction || playAction is AutomaticPlayController || playAction is GameAction)) {
    logger.Error($"Unsupported play action: {playAction?.GetType().FullName}");
    return;
}

Type guard

static bool IsSupportedPlayAction(object action) =>
    action is EmulationPlayAction || action is AutomaticPlayController || action is GameAction;

Prevention

When it happens

Trigger: Starting a game whose controller is GenericPlayController while playAction is a new/unsupported PlayController type or a null/unexpected object. Occurs if a custom extension returns a controller/action combination Playnite's dispatcher was not built to handle.

Common situations: An extension defines a custom play action type not covered by the three branches; an SDK/API version mismatch introduced a new action type the runtime cannot dispatch; controller selection logic returned an unexpected type.

Related errors


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