I need a little help to figure out my problem. I used the ASP.NET kernel and I am pretty familiar with this, although the .NET core C # seems to βcrashβ and exit when I try to execute my asynchronous request request.
I have a method that returns the external IP address of a system
private async Task<string> getExternalIP()
{
using (System.Net.Http.HttpClient HC = new System.Net.Http.HttpClient())
{
return await HC.GetStringAsync("https://api.ipify.org/");
}
}
This should work, but it exits when it reaches HC.GetStringAsync. I also tried to set a breakpoint, but this actually doesn't work.
I am trying to call a method using
string Address = await getExternalIP();
Any help is appreciated, I hope I didnβt just miss something.
Thank!
source
share