{"record":{"id":"31ed3c9e8b885fbd","repo":"microsoft/aspire","slug":"aspire-skills-bundle-contains-an-invalid-version-value-0","errorCode":null,"errorMessage":"Aspire skills bundle contains an invalid version value '{0}'.","messagePattern":"Aspire skills bundle contains an invalid version value '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Agents/AspireSkills/AspireSkillsBundleProvider.cs","lineNumber":723,"sourceCode":"            {\n                var operand = comparator[op.Length..];\n                if (string.IsNullOrWhiteSpace(operand))\n                {\n                    throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, \"Aspire skills bundle contains an invalid version comparator '{0}'.\", comparator));\n                }\n\n                return (op, operand);\n            }\n        }\n\n        return (\"=\", comparator);\n    }\n\n    private static SemVersion ParseCompatibilityVersion(string version)\n    {\n        if (!SemVersion.TryParse(version, SemVersionStyles.Any, out var parsedVersion))\n        {\n            throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, \"Aspire skills bundle contains an invalid version value '{0}'.\", version));\n        }\n\n        return SemVersion.Parse(\n            string.Create(\n                CultureInfo.InvariantCulture,\n                $\"{parsedVersion.Major}.{parsedVersion.Minor}.{parsedVersion.Patch}\"),\n            SemVersionStyles.Strict);\n    }\n}\n","sourceCodeStart":705,"sourceCodeEnd":733,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Agents/AspireSkills/AspireSkillsBundleProvider.cs#L705-L733","documentation":"ParseCompatibilityVersion parses each comparator operand with SemVersion.TryParse (SemVersionStyles.Any); if the operand is not a valid semantic version, this formatted InvalidOperationException is thrown. The parsed version is then normalized to Major.Minor.Patch for comparison.","triggerScenarios":"A range operand like 'latest', '9.x', 'v', or '9.0.0-' that SemVersion cannot parse is used in supports.aspireCli/aspireSdk and evaluated via IsVersionInRange.","commonSituations":"Using wildcard-in-operand styles such as '9.x' as an operand instead of the top-level '*' comparator, 'v'-prefixed strings the parser rejects, or branch names/labels pasted as versions.","solutions":["Replace the operand with a concrete semver, e.g. '>=9.0.0' instead of '>=9.x'","Use top-level wildcard '*' rather than 'x' inside a version operand","Republish the bundle with valid semver operands"],"exampleFix":"// before\n\"supports\": { \"aspireCli\": \">=9.x <10.x\" }\n// after\n\"supports\": { \"aspireCli\": \">=9.0.0 <10.0.0\" }","handlingStrategy":"validation","validationCode":"if (!SemVersion.TryParse(operand, SemVersionStyles.Any, out _))\n    throw new InvalidOperationException($\"'{operand}' is not a valid semver operand; use e.g. 9.0.0.\");","typeGuard":"bool IsValidSemVer(string? v) => v is not null && SemVersion.TryParse(v, SemVersionStyles.Any, out _);","tryCatchPattern":"try\n{\n    await installer.InstallAsync(bundleRef);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"invalid version value\"))\n{\n    logger.LogError(ex, \"Range operand is not valid semver; replace labels like 'latest' or '9.x' with concrete versions.\");\n}","preventionTips":["Use concrete semver operands in ranges, never 'latest', '9.x', or branch names","Express any-version support via the top-level '*' wildcard only","Run a semver linter over manifest ranges before release"],"tags":["cli","skills-bundle","semver","version-parsing"],"backgroundTag":"invalid-date-format","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"}