Click here to Skip to main content
15,881,852 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
Stephen Holdorf3-Feb-20 7:09
Stephen Holdorf3-Feb-20 7:09 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
ZurdoDev3-Feb-20 7:28
professionalZurdoDev3-Feb-20 7:28 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
Stephen Holdorf3-Feb-20 7:34
Stephen Holdorf3-Feb-20 7:34 
GeneralRe: Changing a deployed ASP .NET application URL from .aspx to .com Pin
ZurdoDev3-Feb-20 7:41
professionalZurdoDev3-Feb-20 7:41 
QuestionF12 console JavaScript browser errors when browsing to a WIndows 2012 website Pin
Stephen Holdorf1-Feb-20 9:52
Stephen Holdorf1-Feb-20 9:52 
QuestionArchitectural Guidance Pin
cjb11019-Jan-20 21:30
cjb11019-Jan-20 21:30 
QuestionCalling Web API From Xamarin Forms Pin
Kevin Marois16-Jan-20 9:50
professionalKevin Marois16-Jan-20 9:50 
AnswerRe: Calling Web API From Xamarin Forms Pin
Richard Deeming17-Jan-20 0:48
mveRichard Deeming17-Jan-20 0: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:
C#
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 Tatikonda14-Jan-20 23:46
praveena Tatikonda14-Jan-20 23:46 
AnswerRe: How to handle api call in Angularjs using webservice http method Pin
Richard MacCutchan15-Jan-20 0:01
mveRichard MacCutchan15-Jan-20 0:01 
QuestionPHP MVC :: Which file is responsible for collecting user input? Pin
BlowMagnum14-Jan-20 10:28
BlowMagnum14-Jan-20 10:28 
Questionwhich one is best AngularJS or ReactJS? Pin
Member 147054432-Jan-20 7:27
Member 147054432-Jan-20 7:27 
AnswerRe: which one is best AngularJS or ReactJS? Pin
Richard MacCutchan2-Jan-20 22:02
mveRichard MacCutchan2-Jan-20 22:02 
AnswerRe: which one is best AngularJS or ReactJS? Pin
Nathan Minier6-Jan-20 1:10
professionalNathan Minier6-Jan-20 1:10 
AnswerRe: which one is best AngularJS or ReactJS? Pin
CSSChopper10-Jan-20 0:23
CSSChopper10-Jan-20 0:23 
AnswerRe: which one is best AngularJS or ReactJS? Pin
Member 1473168331-Jan-20 0:22
professionalMember 1473168331-Jan-20 0:22 
QuestionSQLSTATE[42S22]: Column not found: 1054 Unknown column in 'field list' Pin
BlowMagnum25-Dec-19 7:40
BlowMagnum25-Dec-19 7:40 
AnswerRe: SQLSTATE[42S22]: Column not found: 1054 Unknown column in 'field list' Pin
Graham Breach25-Dec-19 20:29
Graham Breach25-Dec-19 20:29 
GeneralRe: SQLSTATE[42S22]: Column not found: 1054 Unknown column in 'field list' Pin
BlowMagnum26-Dec-19 7:32
BlowMagnum26-Dec-19 7:32 
QuestionbNorton Safeweb - anyone else come across this? Pin
DerekT-P18-Dec-19 7:46
professionalDerekT-P18-Dec-19 7:46 
AnswerRe: Norton Safeweb - anyone else come across this? Pin
phil.o25-Dec-19 23:04
professionalphil.o25-Dec-19 23:04 
QuestionWhat is considered "Reusable CSS?" Pin
BlowMagnum18-Dec-19 2:41
BlowMagnum18-Dec-19 2:41 
AnswerRe: What is considered "Reusable CSS?" Pin
BlowMagnum23-Dec-19 2:13
BlowMagnum23-Dec-19 2:13 
QuestionWhen to use position on an element in CSS? Pin
BlowMagnum17-Dec-19 5:56
BlowMagnum17-Dec-19 5:56 
AnswerRe: When to use position on an element in CSS? Pin
Richard Deeming17-Dec-19 6:14
mveRichard Deeming17-Dec-19 6:14 

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.