I\'m getting the above error on the ToList() line of the code below
if (emailReplyTo != null) { System.Collections.Generic.List replyto = ema
In case someone stumbles on this questions after googling...
I had the exact same problem in Razor views and adding using System.Linq at the top didn't help.
using System.Linq
What did help is calling .Cast() before using Linq extension methods:
.Cast()
myArrayVariable.Cast().ToList() //ok, NOW ToList works fine