Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions NuGetResources/NuGetPackageFeed3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,16 @@ internal IEnumerable<PackageBase> Find(string registrationUrl, NuGetSearchContex
// Package is from packageId + version
// PackageRegistration is from packageId
bool isRegistrationType = false;
bool isCatalogRoot = false;
foreach (string t in root.Metadata.type)
{
if (t.Equals("PackageRegistration", StringComparison.OrdinalIgnoreCase))
{
isRegistrationType = true;
break;
}
else if (t.Equals("catalog:CatalogRoot", StringComparison.OrdinalIgnoreCase))
{
isCatalogRoot = true;
}
}

Expand All @@ -100,7 +104,7 @@ internal IEnumerable<PackageBase> Find(string registrationUrl, NuGetSearchContex
// In addition, when DeepMetadataBypass is enabled, we MUST use the registration index to get package info
// If a call to -Name -RequiredVersion is done, DeepMetadataBypass will never be enabled (for now)
// If we wanted, we could enable this by checking if !isRegistrationType && context.EnableDeepMetadataBypass, then call into Find with the registration index URL
if (!context.AllVersions && packageSemanticVersions != null && !context.EnableDeepMetadataBypass)
if (!context.AllVersions && packageSemanticVersions != null && !context.EnableDeepMetadataBypass && !isCatalogRoot)
{
foreach (SemanticVersion packageVersion in context.PackageInfo.AllVersions)
{
Expand Down