microsoft/aspire · error · InvalidOperationException

Aspire skills bundle contains an empty version range.

Error message

Aspire skills bundle contains an empty version range.

What it means

IsVersionInRange splits the manifest's version-range string on commas and whitespace. If no comparator tokens remain (empty or whitespace-only range), the provider throws this InvalidOperationException because an empty range matches nothing and is treated as a manifest authoring error.

Solutions

  1. Use "*" (or a real range like ">=9.0.0") in the manifest to express any-version support instead of an empty string
  2. Remove the empty aspireSdk field entirely if SDK matching is not needed (only aspireCli is mandatory)
  3. Republish the bundle with a corrected range

Example fix

// before
"supports": { "aspireCli": "   " }
// after
"supports": { "aspireCli": "*" }
Defensive patterns

Strategy: validation

Validate before calling

if (string.IsNullOrWhiteSpace(range))
    throw new InvalidOperationException("Version range must be non-empty; use '*' for any version.");

Try / catch

try
{
    await installer.InstallAsync(bundleRef);
}
catch (InvalidOperationException ex) when (ex.Message.Contains("empty version range"))
{
    logger.LogError(ex, "Manifest declares an empty version range; replace with '*' or a real range.");
}

Prevention

When it happens

Trigger: supports.aspireCli or supports.aspireSdk is "", " ", ",", or similar during range evaluation inside IsVersionInRange, reached from ValidateCompatibility.

Common situations: Manifest fields set to placeholder whitespace, JSON trimming leaving only a separator, or authors assuming an empty range means 'any version'.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at src/Aspire.Cli/Agents/AspireSkills/AspireSkillsBundleProvider.cs:664

        if (!string.IsNullOrWhiteSpace(supports.AspireSdk) &&
            !IsVersionInRange(currentSdkVersion, supports.AspireSdk))
        {
            throw new InvalidOperationException(string.Format(
                CultureInfo.InvariantCulture,
                "Aspire skills bundle supports Aspire SDK versions '{0}', but the current SDK version is '{1}'.",
                supports.AspireSdk,
                currentSdkVersion));
        }
    }

    private static bool IsVersionInRange(string version, string range)
    {
        var normalizedVersion = ParseCompatibilityVersion(version);
        var comparators = range.Replace(',', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
        if (comparators.Length == 0)
        {
            throw new InvalidOperationException("Aspire skills bundle contains an empty version range.");
        }

        foreach (var comparator in comparators)
        {
            if (comparator is "*" or "x" or "X")
            {
                continue;
            }

            if (!SatisfiesComparator(normalizedVersion, comparator))
            {
                return false;
            }
        }

        return true;
    }

View on GitHub (pinned to 25830f84bd)