{"record":{"id":"b5c8b904366efe4a","repo":"microsoft/aspire","slug":"aspire-skills-bundle-contains-an-empty-version-range","errorCode":null,"errorMessage":"Aspire skills bundle contains an empty version range.","messagePattern":"Aspire skills bundle contains an empty version range\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Agents/AspireSkills/AspireSkillsBundleProvider.cs","lineNumber":664,"sourceCode":"\n        if (!string.IsNullOrWhiteSpace(supports.AspireSdk) &&\n            !IsVersionInRange(currentSdkVersion, supports.AspireSdk))\n        {\n            throw new InvalidOperationException(string.Format(\n                CultureInfo.InvariantCulture,\n                \"Aspire skills bundle supports Aspire SDK versions '{0}', but the current SDK version is '{1}'.\",\n                supports.AspireSdk,\n                currentSdkVersion));\n        }\n    }\n\n    private static bool IsVersionInRange(string version, string range)\n    {\n        var normalizedVersion = ParseCompatibilityVersion(version);\n        var comparators = range.Replace(',', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);\n        if (comparators.Length == 0)\n        {\n            throw new InvalidOperationException(\"Aspire skills bundle contains an empty version range.\");\n        }\n\n        foreach (var comparator in comparators)\n        {\n            if (comparator is \"*\" or \"x\" or \"X\")\n            {\n                continue;\n            }\n\n            if (!SatisfiesComparator(normalizedVersion, comparator))\n            {\n                return false;\n            }\n        }\n\n        return true;\n    }\n","sourceCodeStart":646,"sourceCodeEnd":682,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Agents/AspireSkills/AspireSkillsBundleProvider.cs#L646-L682","documentation":"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.","triggerScenarios":"supports.aspireCli or supports.aspireSdk is \"\", \"   \", \",\", or similar during range evaluation inside IsVersionInRange, reached from ValidateCompatibility.","commonSituations":"Manifest fields set to placeholder whitespace, JSON trimming leaving only a separator, or authors assuming an empty range means 'any version'.","solutions":["Use \"*\" (or a real range like \">=9.0.0\") in the manifest to express any-version support instead of an empty string","Remove the empty aspireSdk field entirely if SDK matching is not needed (only aspireCli is mandatory)","Republish the bundle with a corrected range"],"exampleFix":"// before\n\"supports\": { \"aspireCli\": \"   \" }\n// after\n\"supports\": { \"aspireCli\": \"*\" }","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(range))\n    throw new InvalidOperationException(\"Version range must be non-empty; use '*' for any version.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await installer.InstallAsync(bundleRef);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"empty version range\"))\n{\n    logger.LogError(ex, \"Manifest declares an empty version range; replace with '*' or a real range.\");\n}","preventionTips":["Never ship manifest fields set to empty or whitespace-only strings","Use \"*\" to express any-version support explicitly","Lint manifests for blank fields before publishing"],"tags":["cli","skills-bundle","version-range","manifest-validation"],"backgroundTag":"empty-required-field","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}