Hello Sir,
I'm using below llink to create and consume a WCF webservice in Xamarin forms(cross platform), but I'm getting a error show below.
Severity Code Description Project File Line Suppression State
Error CS1061 'Task
The data type selected while calling a web service was "System.Collections.Generic.List" for Collection type and for Dictionary collection type it was by default "System.Collections.Generic.Dictionary".- >' does not contain a definition for 'ToList' and no accessible extension method 'ToList' accepting a first argument of type 'Task
- >' could be found (are you missing a using directive or an assembly reference?) LoginForm C:\Users\test\source\repos\LoginForm\LoginForm\LoginForm\MainPage.xaml.cs 26 Active
Below is the code which im using in MainPage.Xaml.cs
private void BtnLogin_Clicked(object sender, EventArgs e)
{
try
{
UserDetails userinfo = new UserDetails();
userinfo.UserName = usernameEntry.Text;
userinfo.Password = passwordEntry.Text;
List msg = obj.LoginUserDetailsAsync(userinfo).ToList();
messageLabel.Text = "Employee Name = " + msg.ElementAt(0) + " Employee Id = " + msg.ElementAt(1);
}
catch (Exception ex)
{
messageLabel.Text = "Wrong Id Or Password";
}
}
Error is displayed on ToList().
Please help me
Thanks in advance

Demo Cloud168 reputationPosted Apr 30, 2020, 5:50 PM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Apr 30, 2020, 5:54 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 5:57 PM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Apr 30, 2020, 6:06 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 6:17 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 6:42 PM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Apr 30, 2020, 6:45 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 6:52 PM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Apr 30, 2020, 6:52 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 7:01 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 7:06 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 7:35 PM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Apr 30, 2020, 7:37 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 8:20 PM EDT
Demo Cloud168 reputationPosted Apr 30, 2020, 8:50 PM EDT
Demo Cloud168 reputationPosted May 1, 2020, 9:04 PM EDT