I would like to display an image in the "Xamarin forms" but I got below error:
Image Loading: Error getting stream for http://www.example.com/example.jpg *(example only)*: System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error: NameResolutionFailure
I had tested that the URL of the image,and it was able to display on the browser.
Below is My code in code-behind:
var imageSource = new UriImageSource { Uri = new Uri("http://www.Example.com/example.jpg") } ;
image.Source = imageSource;
And below is the code that I use in Xaml:
<Image x:Name="image" />
After I google for the solution,I found that ModernHttpClient might be a solution but I have no idea how to implement it.
Or isn't possible I could solve the error without using ModernHttpClient?
Please advice!
Error: NameResolutionFailureWhatever url you are actually using, the domain name was not resolved.... - SushiHangover