Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
VS 2022 17.4.0 Preview 1.0, dotnet 6.0.400
Description
After switching to dotnet maui from xamarin.forms exception occurred Java.Net.MalformedURLException: 'unknown protocol: steammobile. I do not know where the steammobile protocol is, but in xamarin.forms and wpf dotnet 6 are fine.
As far as I understand, HttpClient on android uses HttpURLConnection, and there doesn't seem to be a Java.Net.MalformedURLException with it.
Steps to Reproduce
var url1 = "https://steamcommunity.com";
var url2 = "/mobileconf/conf?";
var client = new HttpClient();
client.BaseAddress = new Uri(url1);
try
{
using var responseMessage = await client.GetAsync(url1 + url2);
}
catch (Java.Net.MalformedURLException e)
{
}
Did you find any workaround?
var url1 = "https://steamcommunity.com";
var url2 = "/mobileconf/conf?";
await Task.Run(() =>
{
Java.Net.URL javaUrl = new Java.Net.URL(url1 + url2);
var connection = (HttpURLConnection) javaUrl.OpenConnection()!;
connection.SetRequestProperty("GET", null);
var code = connection.ResponseCode;
});
Relevant log output
No response
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
VS 2022 17.4.0 Preview 1.0, dotnet 6.0.400
Description
After switching to dotnet maui from xamarin.forms exception occurred
Java.Net.MalformedURLException: 'unknown protocol: steammobile. I do not know where thesteammobileprotocol is, but in xamarin.forms and wpf dotnet 6 are fine.As far as I understand,
HttpClienton android usesHttpURLConnection, and there doesn't seem to be aJava.Net.MalformedURLExceptionwith it.Steps to Reproduce
Did you find any workaround?
Relevant log output
No response