I have a currently simple, WP8 application. Its using Caliburn Micro, and HttpClient (1.5). I have a login form, which collects a username and password then in the ViewModel I have the following code:
try
{
using (var client = new HttpClient())
{
using (var response = await client.PostAsync(RequestGenerator.GetLoginRequest(Username, Password), new StringContent("")))
{
using (var content = response.Content)
{
var data = await content.ReadAsStringAsync();
//result processing code omitted
}
}
}
}
catch (Exception ex)
{
_eventAggregator.Publish(new StopBusyIndicator("LOGIN", true, ex.Message));
throw;
}
On the line using(var response = await client.PostAsync
, if I step through it, it gets a url from the RequestGenertor fine, but then the process just exits.
There's no exception thrown (I have all the exceptions ticked in the Debug -> Exceptions under thrown column). There is nothing. I cannot pause the process either, as Visual Studio says its not not attached to any processes (yet Visual Studio still shows that its in debug mode).
And in the Output Window all I see is:
The program '[3812] TaskHost.exe' has exited with code 0 (0x0).
Switching from PostAsync to GetAsync and vice versa, I get the same issue. If I run this code in a CLI application, it works fine. I've been working on this all morning, and havn't been able to find any reason for it, or to get any useful errors from it.
Any help would be much appreciated.