Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: NuGet SDK client cannot search for packages for a given packageType #11069

Closed
vlada-shubina opened this issue Jul 22, 2021 · 1 comment

Comments

@vlada-shubina
Copy link

NuGet Product Used

dotnet.exe

Product Version

5.10.0, 6.0.0-preview.2.129

Worked before?

No response

Impact

It's more difficult to complete my work

Repro Steps & Context

Product is NuGet Client SDK.
Requirement: search for all packages of package type Template using NuGet SDK:

Code:

            SourceRepository repository = Repository.Factory.GetCoreV3("https://api.nuget.org/v3/index.json");
            var searchResource = await repository.GetResourceAsync<PackageSearchResource>().ConfigureAwait(false);

            var searchFilter = new SearchFilter(includePrerelease: true);
            searchFilter.PackageTypes = new[] { "Template" };
            var searchResult = await searchResource.SearchAsync("", searchFilter, 0, 10, NullLogger.Instance, default);

            foreach (var pack in searchResult)
            {
                Console.WriteLine(pack.Identity.Id);
            }    

Output:

Newtonsoft.Json
Microsoft.Extensions.DependencyInjection
Microsoft.Extensions.Logging
Serilog
Microsoft.EntityFrameworkCore
Castle.Core
Moq
Microsoft.Bcl.AsyncInterfaces
AutoMapper
Microsoft.ApplicationInsights

Expected: only packages of template type is returned.
Actual: packages of any type is returned

Related: dotnet/templating#3498

Note: using https://azuresearch-ussc.nuget.org/query?packageType=Template&skip=0&take=10&prerelease=true works as expected.

Verbose Logs

not applicable
@zivkan
Copy link
Member

zivkan commented Jul 22, 2021

Duplicate of #8915. Please add a 👍 reaction there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants