.Any() causing Index Out Of Bounds exception

Posts   
 
    
Flashjunky
User
Posts: 2
Joined: 06-Sep-2008
# Posted on: 09-Sep-2008 15:20:01   

The following gives me "System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

var meta = new LinqMetaData();
var c = (from l in meta.Promotion.Where(o => o.PromoProductLink.Any() && o.Active == true) select l).ToList();

It works fine in LinqPAD (even though it's a little slow for some reason)

Driving me nuts confused all help gladly received! simple_smile

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 09-Sep-2008 16:47:46   

Which runtime library version are you using?

Flashjunky
User
Posts: 2
Joined: 06-Sep-2008
# Posted on: 09-Sep-2008 16:53:58   

SD.LLBLGen.Pro.LinqSupportClasses.NET35.dll 2.6.08.0814

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39865
Joined: 17-Aug-2003
# Posted on: 09-Sep-2008 18:14:47   

Upgrade to the latest build please.

ALso, an exception without stacktrace is useless. So first, try the latest build (customer area) then if the problem persists, post the full stacktrace as well.

Frans Bouma | Lead developer LLBLGen Pro