Alex Rivera | Logout

System.Array. does not contain a definition for "ToList"

Asked 2011-04-04T12:22:54.740
44

I'm getting the above error on the ToList() line of the code below

if (emailReplyTo != null)
{
  System.Collections.Generic.List<String> replyto
    = emailReplyTo
    // Strip uneccessary spaces
    .Replace(", ", ",")
    .Split(',')
    .ToList();

  request.WithReplyToAddresses(emailReplyTo);
}

I have included using System.Collections; at the top of my file. The target framework is 3.5, so why is this causing an error?

Edit
Report

1 Answer

3

It's because the Enumerable extension methods aren't available.

You need to add "using System.Linq"

answered 2011-04-04T12:25:18.953

Your Answer