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 CloudPosted May 2, 2020, 1:04 AM
Demo CloudPosted May 1, 2020, 12:50 AM
Demo CloudPosted May 1, 2020, 12:20 AM
Rajanikant HawaldarPosted Apr 30, 2020, 11:37 PM
Demo CloudPosted Apr 30, 2020, 11:35 PM
Demo CloudPosted Apr 30, 2020, 11:06 PM
Demo CloudPosted Apr 30, 2020, 11:01 PM
Rajanikant HawaldarPosted Apr 30, 2020, 10:52 PM
Demo CloudPosted Apr 30, 2020, 10:52 PM
Rajanikant HawaldarPosted Apr 30, 2020, 10:45 PM
Demo CloudPosted Apr 30, 2020, 10:42 PM
Demo CloudPosted Apr 30, 2020, 10:17 PM
Rajanikant HawaldarPosted Apr 30, 2020, 10:06 PM
Demo CloudPosted Apr 30, 2020, 9:57 PM
Rajanikant HawaldarPosted Apr 30, 2020, 9:54 PM
Demo CloudPosted Apr 30, 2020, 9:50 PM