Here is the sample code.
var values = new List<string>() { "Stack", "Over", "Go" }; var funcs = new List<Func<string>>(); foreach(var v in values) funcs.Add( ()=>v ); foreach(var f in funcs) Console.WriteLine(f()); When I ran this code with visual studio 2010 I got the output as: Go Go Go
But when I tried the same code in visual studio 2012 the output was: Stack Over Go
Why is it behaving differently?
stupid stupid stupidorBob is stupid?Go Go GoandStack Over Go, but post the code which is generating the output you have mentioned.