Repository navigation
Description
The way that NuGet.Protocol works with package type filtering is changing.
Previously:
SearchFilter.PackageTypeswas data typeIEnumerable<string>- Each value would result in
&packageTypeFilter={value}being appended to the URL.
Now:
SearchFilter.PackageTypesis removedstring SearchFilter.PackageTypeis added (so, a singular version of the previous property)- When non-empty,
&packageType={value}will be appended to the string. PackageSearchResource.SearchAsyncwill throw on feeds that don't support package type filtering ifSearchFilter.PackageTypeis not null or empty. UsePackageSearchResource.SupportsPackageTypeFilteringto decide whether to usePackageTypein the search.
The reason is that nuget.org never supported the old packageTypeFilter={value} query parameter. When they implemented package type filtering, they look for the parameter name packageType. While it's possible that different NuGet server implementations might have used packageTypeFilter, we believe it's unlikely. There have been multiple customers, including the .NET SDK itself, which want to use nuget.org's package type filtering, so supporting nuget.org's syntax will be valuable.
nuget.org's implementation also only allows a single value to be filtered, hence removing the old collection property and adding the new single value property.
So, the APIs were modified to align with what nuget.org actually implemented. Although the .NET SDK has supported package type filtering with dotnet tool search for several years now, they only support nuget.org's query syntax (without using NuGet.Protocol). The NuGet team's Visual Studio integration (Package Manager UI and Console) never supported any package type filtering, not did any NuGet.exe or NuGet team owned dotnet CLI commands. We therefore believe it's unlikely any other NuGet server has implemented packageTypeFilter, or that many apps referencing NuGet.Protocol will be attempting to use SearchFilter.PackageTypes. With all of this considered, we decided not to provide backwards compatibility for the API.
Activity
dotnet-policy-service commentedon Jun 11, 2026
Issue is missing Type label, remember to add a Type label