{"record":{"id":"c256050a0f7cd0df","repo":"microsoft/aspire","slug":"no-template-versions-were-found-please-check-your-internet","errorCode":null,"errorMessage":"No template versions were found. Please check your internet connection or NuGet source configuration.","messagePattern":"No template versions were found\\. Please check your internet connection or NuGet source configuration\\.","errorType":"exception","errorClass":"EmptyChoicesException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Templating/TemplateNuGetConfigService.cs","lineNumber":363,"sourceCode":"        if (query.VersionOverride is { } version)\n        {\n            var explicitMatch = orderedPackagesFromChannels.FirstOrDefault(p =>\n                string.Equals(p.Package.Version, version, StringComparison.OrdinalIgnoreCase));\n            if (explicitMatch.Package is not null)\n            {\n                return new TemplatePackageSelection(explicitMatch.Package, explicitMatch.Channel);\n            }\n\n            throw new EmptyChoicesException(\n                string.Format(\n                    CultureInfo.CurrentCulture,\n                    Resources.TemplatingStrings.TemplateVersionNotFound,\n                    version));\n        }\n\n        if (!packagesFromChannels.Any())\n        {\n            throw new EmptyChoicesException(Resources.TemplatingStrings.NoTemplateVersionsFound);\n        }\n\n        if (VersionHelper.TryGetCurrentCliVersionMatch(\n            orderedPackagesFromChannels,\n            p => p.Package.Version,\n            executionContext.IdentitySdkVersion,\n            out var cliVersionMatch,\n            channelName: query.RequestedChannel,\n            hasPrHives: hasPrHives))\n        {\n            return new TemplatePackageSelection(cliVersionMatch.Package, cliVersionMatch.Channel);\n        }\n\n        // If channel was specified via --channel option or per-project aspire.config.json\n        // (but no --version), automatically select the highest version from that channel\n        // without prompting.\n        if (!string.IsNullOrEmpty(query.RequestedChannel))\n        {","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Templating/TemplateNuGetConfigService.cs#L345-L381","documentation":"Thrown by ResolveTemplatePackageAsync when the channel/source enumeration returns zero Aspire.ProjectTemplates packages at all. This usually means the CLI could not reach or read any NuGet source, so no template versions could be discovered.","triggerScenarios":"Resolving template packages when every configured feed returns an empty package list — all sources unreachable, misconfigured sources, or credential failures that silently yield no packages.","commonSituations":"No internet connection; corporate proxy blocking nuget.org; NuGet.config pointing only at unreachable internal feeds; expired feed credentials; ASPIRE_CLI_PACKAGES directory empty.","solutions":["Check network connectivity and retry.","Verify NuGet source configuration (nuget.org or your internal mirror) and credentials.","Point ASPIRE_CLI_PACKAGES at a directory containing staged packages to use local resolution.","Add an explicit reachable source with --source."],"exampleFix":"// before\n# sources unreachable, empty package list\n// after\ncurl -I https://api.nuget.org/v3/index.json   # verify connectivity\naspire new --source https://api.nuget.org/v3/index.json","handlingStrategy":"retry","validationCode":"using var ping = new HttpClient();\nvar ok = await ping.GetAsync(\"https://api.nuget.org/v3/index.json\") is { IsSuccessStatusCode: true };","typeGuard":null,"tryCatchPattern":"try { await ResolveTemplatePackageAsync(...); }\ncatch (EmptyChoicesException) { // check network/nuget sources, then retry with backoff\n}","preventionTips":["Verify connectivity to nuget.org or your internal feed before template creation.","Keep NuGet.config sources valid and credentials current.","Don't run in fully offline environments without staged packages (ASPIRE_CLI_PACKAGES)."],"tags":["cli","nuget","network","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}