JosefNemec/Playnite · error · NotSupportedException

Uknown extension type {options.Type}.

Error message

Uknown extension type {options.Type}.

What it means

Thrown by the `new` verb's switch in Program.cs when options.Type does not match any handled ItemType case. The default branch raises NotSupportedException. Note the ItemType enum's first member is `Uknown` (value 0), which is also the parser default — so an unrecognized or empty type argument parses to Uknown and falls through to default.

Source

Thrown at source/Tools/Playnite.Toolbox/Program.cs:136

                        outPath = Themes.GenerateNewTheme(ApplicationMode.Desktop, options.Name);
                        break;
                    case ItemType.FullscreenTheme:
                        outPath = Themes.GenerateNewTheme(ApplicationMode.Fullscreen, options.Name);
                        break;
                    case ItemType.PowerShellScript:
                        outPath = Extensions.GenerateScriptExtension(options.Name, options.OutDirectory);
                        break;
                    case ItemType.GenericPlugin:
                        outPath = Extensions.GeneratePluginExtension(ExtensionType.GenericPlugin, options.Name, options.OutDirectory);
                        break;
                    case ItemType.MetadataPlugin:
                        outPath = Extensions.GeneratePluginExtension(ExtensionType.MetadataProvider, options.Name, options.OutDirectory);
                        break;
                    case ItemType.LibraryPlugin:
                        outPath = Extensions.GeneratePluginExtension(ExtensionType.GameLibrary, options.Name, options.OutDirectory);
                        break;
                    default:
                        throw new NotSupportedException($"Uknown extension type {options.Type}.");
                }

                logger.Info($"Created new {options.Type} in \"{outPath}\"");
                logger.Warn($"Don't forget to update manifest file with relevant information.");
                if (options.Type == ItemType.GenericPlugin || options.Type == ItemType.LibraryPlugin || options.Type == ItemType.MetadataPlugin)
                {
                    logger.Warn($"Use generated .sln solution file to open plugin source.");
                }
            }
            catch (Exception e) when (!Debugger.IsAttached)
            {
                AppResult = 1;
                logger.Error(e, $"Failed to create new {options.Type}." + Environment.NewLine + e.Message);
            }
        }

        public static void ProcessPackOptions(PackCmdLineOptions options)
        {

View on GitHub (pinned to 5911f4e964)

Solutions

  1. Use one of the exact enum names: `Toolbox new GenericPlugin MyPlugin` (PascalCase, no spaces, no hyphens).
  2. If unsure of valid types, pass an intentionally invalid type and read the exception, or consult the ItemType enum in CmdLineOptions.cs.
  3. For library/metadata plugins use `LibraryPlugin` / `MetadataPlugin` respectively — these map to GameLibrary/MetadataProvider ExtensionTypes internally.
  4. Avoid the value `Uknown` — it is the sentinel default and is intentionally not handled.

Example fix

// before
//   Toolbox new generic-plugin MyPlugin   -> NotSupportedException

// after
//   Toolbox new GenericPlugin MyPlugin
Defensive patterns

Strategy: type-guard

Type guard

static bool IsSupportedItemType(ItemType t) =>
    t == ItemType.DesktopTheme || t == ItemType.FullscreenTheme ||
    t == ItemType.PowerShellScript || t == ItemType.GenericPlugin ||
    t == ItemType.MetadataPlugin || t == ItemType.LibraryPlugin;

// before the switch:
if (!IsSupportedItemType(options.Type))
    throw new ArgumentException($"Unsupported/unknown add-on type: {options.Type}");

Prevention

When it happens

Trigger: Running `Toolbox new <type>` where <type> is not one of: DesktopTheme, FullscreenTheme, PowerShellScript, GenericPlugin, MetadataPlugin, LibraryPlugin. Also triggered by passing no type (defaults to ItemType.Uknown) or a typo such as `generic-plugin` vs `GenericPlugin`.

Common situations: Case mismatch (CommandLine parsing of the enum is case-sensitive); using a hyphenated form; copying a verb name from outdated docs; passing `help` or `list` expecting it to enumerate types.

Related errors


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