-1
HttpResponseMessage response = 
    client.GetAsync("api/MOB_Vw_UsersAPI/GetMOB_Vw_Users?Uname=" + 
       uname + "&Pass=" + pass).Result;

When I run this part of code on Windows Phone emulator things going well and it works fine. However, when I run it on an Android emulator it gives me this strange error:

System.AggregateException one or more errors occurred.

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
FSD
  • 375
  • 3
  • 15
  • 1
    An AggregateException is a bundle of Exceptions. Look at the InnerException to get more detail. – Jason Sep 18 '16 at 12:51

1 Answers1

2

What you are seeing here is an AggregateException, which means that the async method you are calling synchronously with .Result (which is bad) is failing internally for some reason.

Checking the InnerException(s), would reveal why the error occurs.

Please stop calling async methods synchronously or you are going to encounter bad issues and you will lock up your UI and potentially deadlock your application making it unresponsive.

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118