1

I got code like this. When I execute it I got ExecutionEngineException and my app got shut down. I don't know what can I do to fix it. Any ideas? According to my research it's shouldn't be caused by my code. It didn't caused this error before. I just changed views using blend (imported them from photoshop and created controls to be more precious)

public async Task<string> postAsync(string adress,string json) 
    {
        HttpClient httpClient = new HttpClient();
        httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        httpClient.DefaultRequestHeaders.ConnectionClose = true;
        var response = await httpClient.PostAsync(basicUrl + adress, new StringContent(json, Encoding.UTF8, "application/json"));
        //response.EnsureSuccessStatusCode();
        var responseJson = await response.Content.ReadAsStringAsync();
        return responseJson;
    }
  • Do you know what line causes the error? Can you post how to reproduce the error? There really is not enough information here to assist you. – Jeff Sanders - MSFT Oct 20 '14 at 18:43
  • These with await. I run page "login.xaml", then I try send login credits using postAsync method and it got this exception sometimes on first await sometimes on second. – Radosław Kunecki Oct 21 '14 at 16:07
  • http://i.imgur.com/jCU87y6.png A little bit more information. – Radosław Kunecki Oct 21 '14 at 20:03
  • I still do not see enough to assist. Some tips for you to isolate this: Inspect the http traffic using fiddler. See if there is something unique about the traffic when you get the exception. Profile your app and see if there are memory issues. Try and put together a simple repro of the project and post it. Finally list the message and innerException when you get the exception. – Jeff Sanders - MSFT Oct 23 '14 at 09:03

0 Answers0