microsoft/aspire · error · NotSupportedException

Polyglot skeleton not yet supported for language

Error message

Polyglot skeleton not yet supported for language: {languageId}

What it means

'aspire init --language <id>' drops a polyglot skeleton per language, but only languages the CLI can discover support it. DropPolyglotSkeletonAsync throws NotSupportedException when the language id is not registered with the language discovery service.

Solutions

  1. Run the language list (e.g. 'aspire init --help' or the language discovery output) and use a supported language id
  2. Correct the language id spelling
  3. Update the Aspire CLI to a version that supports the desired language

Example fix

// before
aspire init --language cpp
// after
aspire init --language csharp  // use a supported language id from 'aspire init --help'
Defensive patterns

Strategy: validation

Validate before calling

var supported = languageDiscovery.GetSupportedLanguageIds();
if (!supported.Contains(languageId))
{
    Console.Error.WriteLine($"Unsupported language '{languageId}'. Supported: {string.Join(", ", supported)}");
    return 1;
}

Type guard

bool isSupported = languageDiscovery.GetLanguageById(languageId) is not null;

Try / catch

try
{
    exitCode = await command.RunAsync(...);
}
catch (NotSupportedException ex) when (ex.Message.Contains("Polyglot skeleton not yet supported"))
{
    Console.Error.WriteLine(ex.Message + " Use a supported language id.");
    exitCode = 1;
}

Prevention

When it happens

Trigger: Running 'aspire init' (polyglot mode) with a --language value that GetLanguageById cannot resolve — an unsupported/unknown language id or one not yet implemented for skeletons.

Common situations: Passing an id the CLI does not recognize (e.g. a niche language or misspelled id like 'py' instead of 'python', depending on supported ids); using a newer language before the CLI supports it.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16). Data as JSON: /api/errors/c804b9e5a4e6231a. Report an issue: GitHub.

Appendix: source

Thrown at src/Aspire.Cli/Commands/InitCommand.cs:491

                    options: new ProcessInvocationOptions(),
                    cancellationToken: cancellationToken);
            });

        if (result != 0)
        {
            InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FailedToCreateAppHostFromTemplate, result));
            return CliExitCodes.FailedToCreateNewProject;
        }

        InteractionService.DisplayMessage(KnownEmojis.CheckMarkButton, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.CreatedFile, $"{appHostDirName}/"));

        return CliExitCodes.Success;
    }

    private async Task<int> DropPolyglotSkeletonAsync(string languageId, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
    {
        var language = _languageDiscovery.GetLanguageById(languageId)
            ?? throw new NotSupportedException($"Polyglot skeleton not yet supported for language: {languageId}");

        var existingAppHostFileName = language.DetectionPatterns
            .Where(pattern => !pattern.Contains('*', StringComparison.Ordinal))
            .FirstOrDefault(pattern => File.Exists(Path.Combine(workingDirectory.FullName, pattern)));
        if (existingAppHostFileName is not null)
        {
            InteractionService.DisplayMessage(KnownEmojis.Information, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FileAlreadyExistsSkipping, existingAppHostFileName));
            return CliExitCodes.Success;
        }

        var appHostPath = ScaffoldingService.GetAppHostPath(workingDirectory, language);
        var displayPath = PathNormalizer.NormalizePathForStorage(Path.GetRelativePath(workingDirectory.FullName, appHostPath));
        if (File.Exists(appHostPath))
        {
            InteractionService.DisplayMessage(KnownEmojis.Information, string.Format(CultureInfo.CurrentCulture, InitCommandStrings.FileAlreadyExistsSkipping, displayPath));
            return CliExitCodes.Success;
        }

View on GitHub (pinned to 25830f84bd)