Searching for packages goes into an endless loop

19 views
Skip to first unread message

Artem Smirnov

unread,
Nov 12, 2014, 3:43:03 PM11/12/14
to nuget-e...@googlegroups.com
Hi,

I'm using the following code to search for packages by a partial match (i.e., same as you do in Visual Studio):

var packageRepository = PackageRepositoryFactory.Default.CreateRepository(NuGetConstants.DefaultFeedUrl);
foreach (var package in packageRepository.Search("mvc", false)) {
        //Console.WriteLine(package.Id);
}

When I search for "Shouldly", the code works perfect, finding a single entry. When I search for "mvc", it goes into an endless loop. The loop happens in DataServiceQueryWrapper.GetAll method -- because the results variable, when calling GetContinuation(), returns the same continiation object over and over again. For some reason not clear to me, it all depends on the NextPageLink property set somewhere deep down the stack (I can provide it if needed). When I search for "Shouldly", this property is null, and thus the GetContinuation method returns null, and the loop never happens.

How do I search for packages properly, so that I don't have this problem. I think it only started recently, although i cannot tell exactly. My code wasn't changed, so I guess it's something on the Nuget server side.

Thank you in advance

artem
Reply all
Reply to author
Forward
0 new messages