0
votes

why the response of the web service crash if the app goes to Background after calling a web service? does anyone know a workaround to let web service work in background. below in the second line of code my app crash .....

HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);//Crash
Stream streamResponse = response.GetResponseStream();
StreamReader streamRead = new StreamReader(streamResponse);
string responseString = streamRead.ReadToEnd();

......

1

1 Answers

0
votes

when App goes to Background it is put in the Sleep mode, thus, aborting all current activities. To prevent from this you can allow your app to run in background in WP8 settings.

Also, check this StackOverflow answer. It describes certain aspects regarding background support.