Click here to Skip to main content
14,449,906 members

Web Development

 
PinnedHow to get an answer to your question Pin
Chris Maunder4-Sep-10 3:25
cofounderChris Maunder4-Sep-10 3:25 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 23:40
cofounderChris Maunder12-Jul-09 23:40 
QuestionHow do I fix the push sidebar menu CSS? Pin
Member 1474620516-Feb-20 9:19
MemberMember 1474620516-Feb-20 9:19 
QuestionBest place o learn HTML and CSS for a jack of all trades Pin
enginestar3-Feb-20 21:38
Memberenginestar3-Feb-20 21:38 
AnswerRe: Best place o learn HTML and CSS for a jack of all trades Pin
Eddy Vluggen16-Feb-20 12:24
professionalEddy Vluggen16-Feb-20 12:24 
AnswerRe: Best place o learn HTML and CSS for a jack of all trades Pin
owensdj16-Feb-20 21:22
Memberowensdj16-Feb-20 21:22 
QuestionOnline Offline Mode Program. Getting started, Visual Studio. Where do i begin? Pin
HoneRobotics3-Feb-20 10:39
MemberHoneRobotics3-Feb-20 10:39 
QuestionChanging a deployed ASP .NET application URL from .aspx to .com Pin
holdorf3-Feb-20 5:08
Memberholdorf3-Feb-20 5:08 
AnswerRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
ZurdoDev3-Feb-20 5:46
mveZurdoDev3-Feb-20 5:46 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
holdorf3-Feb-20 6:12
Memberholdorf3-Feb-20 6:12 
AnswerRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
ZurdoDev3-Feb-20 6:35
mveZurdoDev3-Feb-20 6:35 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
holdorf3-Feb-20 6:48
Memberholdorf3-Feb-20 6:48 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
ZurdoDev3-Feb-20 6:56
mveZurdoDev3-Feb-20 6:56 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
holdorf3-Feb-20 8:09
Memberholdorf3-Feb-20 8:09 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
ZurdoDev3-Feb-20 8:28
mveZurdoDev3-Feb-20 8:28 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
holdorf3-Feb-20 8:34
Memberholdorf3-Feb-20 8:34 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
ZurdoDev3-Feb-20 8:41
mveZurdoDev3-Feb-20 8:41 
AnswerMessage Closed Pin
13-Feb-20 1:07
Memberrourou1713-Feb-20 1:07 
QuestionF12 console JavaScript browser errors when browsing to a WIndows 2012 website Pin
holdorf1-Feb-20 10:52
Memberholdorf1-Feb-20 10:52 
QuestionArchitectural Guidance Pin
cjb11019-Jan-20 22:30
Membercjb11019-Jan-20 22:30 
QuestionCalling Web API From Xamarin Forms Pin
Kevin Marois16-Jan-20 10:50
professionalKevin Marois16-Jan-20 10:50 
AnswerRe: Calling Web API From Xamarin Forms Pin
Richard Deeming17-Jan-20 1:48
communityengineerRichard Deeming17-Jan-20 1:48 
That's usually an indication that there's a deadlock trying to call back into the UI thread. That's often caused by using sync-over-async - waiting synchronously for an async task to complete.

I notice you're using .Result within your method to read the content, rather than awaiting the task. You probably have other places in your code doing something similar.

Try adding .ConfigureAwait(false) to the async calls, and removing the .Result access:
private async Task<string> GetServerMessageAsync()
{
    string response = string.Empty;

    HttpClient client = new HttpClient();
    client.BaseAddress = new Uri(url);
    client.DefaultRequestHeaders.Accept.Clear();
    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

    HttpResponseMessage responseMessage = await client.GetAsync(url).ConfigureAwait(false);
    if (responseMessage.IsSuccessStatusCode)
    {
        response = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
    }

    return response;
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

QuestionHow to handle api call in Angularjs using webservice http method Pin
praveena Tatikonda15-Jan-20 0:46
Memberpraveena Tatikonda15-Jan-20 0:46 
AnswerRe: How to handle api call in Angularjs using webservice http method Pin
Richard MacCutchan15-Jan-20 1:01
communityengineerRichard MacCutchan15-Jan-20 1:01 
QuestionPHP MVC :: Which file is responsible for collecting user input? Pin
BlowMagnum14-Jan-20 11:28
MemberBlowMagnum14-Jan-20 11:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.