I am trying to run this code in this answer https://stackoverflow.com/a/1430489/2102329 whose call to ToList() relies on the extension methods in the referenced assembly System.Data.DataSetExtensions.dll.
DataTable dtUserAccounts = sp.getDataTable();
List<UserAccount> listOfUserAccounts;
dtUserAccounts.AsEnumerable().Select(m => new UserAccount()
{
UserId = m.Field<string>("UserId"),
FirstName = m.Field<string>("FirstName"),
LastName = m.Field<string>("LastName")
}). //<-- ToList() is not available
I have reviewed similar cases on StackOverflow but cannot get this to work. I am using Visual Studio 2017 but the original project will have been created in an earlier version.
The code is in a public method of a public class in the project's default namespace. I have the correct using statement for System.Data already. The project targets .NET 4.7.1.
The extension methods are not available. In References there are both System.Data and System.Data.DataSetExtensions (I have removed and added these back in to be sure).
I have tried cleaning the solution and rebuilding.
I have even created an additional project in the same VS 2017 solution targeting the same .NET version and this actually works so this is my fudge of a workaround but I must be missing something here.