Thanks for your answer I produced the error. It's no bug!
I had no elements in the list or the list wasn't initialized when I make the .Max-Operation. Sorry 2010/10/20 Jb Evain <j...@nurv.fr>: > Hi, > > On Wed, Oct 20, 2010 at 1:58 PM, Chakotey STME <chakoteys...@gmail.com> wrote: >> I have a vb.net project (.net 3.5). >> I use this Linq-Statement: >> >> Dim minPosition = myIndexing.Where(Function(x) x.Key < >> beginTime).SelectMany(Function(x) x.Value).ToList >> >> It works perfect under .net and mono 2.6 >> >> But I get an exception if I use this operation (i get the exception >> only under mono - with .net it works perfect): >> >> Dim MaxValue = minPosition.Max >> >> The exception: >> Unhandled Exception: System.InvalidOperationException: Operation is >> not valid due to the current state of the object >> at System.Linq.Enumerable.Iterate[Int64,Int64] (IEnumerable`1 >> source, Int64 initValue, System.Func`3 selector) [0x00000] in >> <filename unknown>:0 >> at System.Linq.Enumerable.Max (IEnumerable`1 source) [0x00000] in >> <filename unknown>:0 >> at FileReader.Module1.getObenUndUnten >> (System.Collections.Generic.Dictionary`2& myIndexing, Int32 beginTime, >> Int32 endTime) [0x00000] in <filename unknown>:0 >> at FileReader.Module1.Main () [0x00000] in <filename unknown>:0 > > Sorry but it's not exactly clear what you're doing that is triggering > the exception. Could you please write a small standalone repro? > > Thanks, > > -- > Jb Evain <j...@nurv.fr> > _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list