{"record":{"id":"d09cbf5b1a29d46b","repo":"abpframework/abp","slug":"packagename-nuget-package-could-not-be-found","errorCode":null,"errorMessage":"'{packageName}' nuget package could not be found!","messagePattern":"'(.+?)' nuget package could not be found!","errorType":"exception","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs","lineNumber":376,"sourceCode":"    {\n        var projectFileContent = File.ReadAllText(projectFile);\n        return SolutionPackageVersionFinder.TryParseVersionFromCsprojFile(projectFileContent, out var version)\n            ? version\n            : null;\n    }\n\n    protected virtual async Task<NugetPackageInfo> FindNugetPackageInfoAsync(string packageName)\n    {\n        var url = $\"{CliUrls.WwwAbpIo}api/app/nugetPackage/byName/?name=\" + packageName;\n        var client = _cliHttpClientFactory.CreateClient();\n\n        using (var response = await client.GetAsync(url, _cliHttpClientFactory.GetCancellationToken()))\n        {\n            if (!response.IsSuccessStatusCode)\n            {\n                if (response.StatusCode == HttpStatusCode.NotFound)\n                {\n                    throw new CliUsageException($\"'{packageName}' nuget package could not be found!\");\n                }\n\n                await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);\n            }\n\n            var responseContent = await response.Content.ReadAsStringAsync();\n            return JsonSerializer.Deserialize<NugetPackageInfo>(responseContent);\n        }\n    }\n\n    protected virtual async Task RunBundleForBlazorAsync(string projectFile)\n    {\n        var args = new CommandLineArgs(\"bundle\");\n\n        args.Options.Add(BundleCommand.Options.WorkingDirectory.Short, Path.GetDirectoryName(projectFile));\n        args.Options.Add(BundleCommand.Options.ForceBuild.Short, string.Empty);\n\n        await BundleCommand.ExecuteAsync(args);","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs#L358-L394","documentation":"FindNugetPackageInfoAsync GETs www.abp.io/api/app/nugetPackage/byName/?name=<packageName> and throws a CliUsageException on 404 NotFound. The catalog does not know the package name; other non-success codes go to RemoteServiceExceptionHandler. Mirrors the NPM equivalent (error 205) but for NuGet metadata.","triggerScenarios":"Running 'abp add-package <nugetName>' where <nugetName> is not in the ABP NuGet package catalog, or calling ProjectNugetPackageAdder with an unknown package identifier.","commonSituations":"Typo in the package name; third-party package not registered with ABP; package only in a newer catalog than the CLI version; confusing a module name with its NuGet package name.","solutions":["Confirm the exact NuGet package name (e.g. 'Volo.Abp.AspNetCore.Mvc') on nuget.org or ABP docs and re-run.","Upgrade the ABP CLI so the catalog lookup reflects current package names.","If the package is not an ABP module, install it directly with 'dotnet add package <name>'."],"exampleFix":"// before\nabp add-package Volo.Abp.Mvc   // wrong name\n// after\nabp add-package Volo.Abp.AspNetCore.Mvc","handlingStrategy":"validation","validationCode":"using var http = new HttpClient();\nvar resp = await http.GetAsync($\"https://www.abp.io/api/app/nugetPackage/byName/?name={packageName}\");\nif (resp.StatusCode == HttpStatusCode.NotFound)\n{ Console.Error.WriteLine($\"NuGet package '{packageName}' not in catalog.\"); return; }","typeGuard":null,"tryCatchPattern":"try { await ProjectNugetPackageAdder.AddAsync(packageName); }\ncatch (CliUsageException ex) when (ex.Message.Contains(\"nuget package could not be found\"))\n{ Console.Error.WriteLine(ex.Message); }","preventionTips":["Cross-check NuGet package names against nuget.org before scripting.","Upgrade the CLI when package names change between major versions."],"tags":["cli","nuget","package-management","http","not-found"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}