microsoft/aspire · error · ProjectUpdaterException

No package found with ID

Error message

No package found with ID '{packageId}' in channel '{context.Channel.Name}'.

What it means

GetLatestVersionOfPackageAsync queries the configured package channel for the newest version of a package ID. When the channel returns no package and throwIfNotFound is true, it throws ProjectUpdaterException with NoPackageFoundFormat naming the package ID and channel; when throwIfNotFound is false it only logs a warning and returns null, letting the updater skip that package.

Solutions

  1. Check the package ID spelling against the project file — IDs are case-sensitive in some feeds.
  2. Verify the package exists on the channel's feed (open the feed URL / dotnet package search) and that the mirror is synced.
  3. Add the missing source (e.g. nuget.org) to the channel's NuGet.config, or switch to a channel that includes it.
  4. If the package is intentionally optional, use the non-throwing path so the updater logs a warning and skips it instead of failing the update.

Example fix

// before (feed missing the package)
<packageSources><add key="internal-mirror" value="https://mirror.internal/limited/v3/index.json" /></packageSources>
// after (add upstream)
<packageSources><add key="internal-mirror" value="https://mirror.internal/limited/v3/index.json" /><add key="nuget" value="https://api.nuget.org/v3/index.json" /></packageSources>
Defensive patterns

Strategy: validation

Validate before calling

// Verify the package exists on the channel's feed before updating
var search = await dotnet.RunAsync($"package search {packageId} --source {feedUrl}");
if (search.ExitCode != 0 || string.IsNullOrWhiteSpace(search.Stdout))
    throw new InvalidOperationException($"{packageId} not found on {feedUrl}");

Try / catch

try
{
    var version = await updater.GetLatestVersionOfPackageAsync(packageId, context, throwIfNotFound: true, cancellationToken);
}
catch (ProjectUpdaterException ex) when (ex.Message.Contains("No package found"))
{
    Console.Error.WriteLine($"{packageId} missing from channel; check feed config or ID spelling.");
}

Prevention

When it happens

Trigger: GetLatestVersionOfPackageAsync (used by latestSdkPackage/latestPackage flows) querying a channel whose package search yields no entry for the requested packageId, with throwIfNotFound=true — i.e. an explicit channel missing the package.

Common situations: Explicit channel configured with a narrow feed (staging mirror, pinned NuGet.config source) that does not host the package; typo in package ID; the package was renamed/unlisted upstream; offline or partially-synced mirror missing recent packages; version range filters excluding all published versions.

Related errors


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

Appendix: source

Thrown at src/Aspire.Cli/Projects/ProjectUpdater.cs:395

    private async Task<NuGetPackageCli?> GetLatestVersionOfPackageAsync(UpdateContext context, string packageId, bool throwIfNotFound = true, CancellationToken cancellationToken = default)
    {
        var cacheKey = $"LatestPackage-{packageId}";
        var latestPackage = await cache.GetOrCreateAsync(cacheKey, async entry =>
        {
            var packages = await context.Channel.GetPackagesAsync(packageId, context.AppHostProjectFile.Directory!, cancellationToken);
            // Filter out packages with invalid semantic versions and find the latest valid one
            var latestPackage = packages
                .Where(p => SemVersion.TryParse(p.Version, SemVersionStyles.Strict, out _))
                .OrderByDescending(p => SemVersion.Parse(p.Version, SemVersionStyles.Strict), SemVersion.PrecedenceComparer)
                .FirstOrDefault();
            return latestPackage;
        });

        if (latestPackage is null)
        {
            if (throwIfNotFound)
            {
                throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.NoPackageFoundFormat, packageId, context.Channel.Name));
            }

            logger.LogWarning(UpdateCommandStrings.PackageNotFoundInChannelWarningFormat, packageId, context.Channel.Name);
            return null;
        }

        return latestPackage;
    }

    private async Task AnalyzeAppHostSdkAsync(UpdateContext context, CancellationToken cancellationToken)
    {
        logger.LogDebug("Analyzing App Host SDK for: {AppHostFile}", context.AppHostProjectFile.FullName);

        var itemsAndPropertiesDocument = await GetItemsAndPropertiesWithFallbackAsync(context.AppHostProjectFile, context, cancellationToken);
        var propertiesElement = itemsAndPropertiesDocument.RootElement.GetProperty("Properties");
        var sdkVersionElement = propertiesElement.GetProperty("AspireHostingSDKVersion");
        var sdkVersion = sdkVersionElement.GetString();

View on GitHub (pinned to 25830f84bd)