Open Thobs-Tricks opened 6 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Hi @Thobs-Tricks , are you saying that the whole emulator crashes? Or the app you wrote is crashing within the emulator?
The app i wrote crashes within emulator, when I click a button,
below is the code inside my .cs file
////////////////////
using team34App.Pages;
namespace team34App;
public partial class LoginPage : ContentPage
{
ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client();
public LoginPage()
{
InitializeComponent();
}
private void OnLoginClicked(object sender, EventArgs e)
{
int lgn = sc.Login(enUser.Text.ToString(), enPass.Text.ToString());
string usr = sc.GetUserType(lgn);
if(lgn == 0)
{
lblError.Text = "User Not Found/Eligible To Login";
}else
{
Navigation.PushAsync(new HomePage(lgn));
}
}
}
Going by the stack trace, I believe this will either be a runtime bug, or an issue with your service. There's a connection issue with accessing your service and my guess is that if you deployed a .NET Android app without the MAUI UI Toolkit and ran that code, you would hit the same error.
@Eilon IMO I think this should be moved to runtime.
Well, I use the following link to connect the Service with the App.
http://localhost:57888/Service1.svc
The link works when I connect the Service with ASP .NET for web dev,
I don't doubt you have an issue; it's that based on that stack trace, your issue isn't a MAUI UI one, but a runtime issue. The underlying exception is in System.ServiceModel.Channels
, and I'm willing to bet if you run your app using just .NET Android without the MAUI UI Toolkit, you'll hit the same exception. So I want to make sure, if this is indeed the issue, it goes to the correct location for it to be fixed, otherwise it will sit here and won't be touched.
ooh yeah, then please kindly move it to runtime issue slot,
@Thobs-Tricks Thanks for the feedback, but repro sample would help a lot to speed up investigations.
Try catching System.ServiceModel.CommunicationException
and investigate details of the exception.
It does not look like MAUI exception, but:
From the runtime team (links below):
There are two workarounds that might apply in some scenarios:
- disable compression in the Andorid client
- add the following property to the .csproj file to switch from the AndroidMessageHandler to SocketsHttpHandler that decompresses the content correctly:
<UseNativeHttpHandler>false</UseNativeHttpHandler>
Additional questions:
More details collected during investigating this issue:
Error reading response from wcf service in basicHttpBinding dotnet/maui#14836
[Android] Deserialization issue when consuming ASMX Web Service dotnet/runtime#80935
I cannot established connection with WCF services in Xamarin
Can't call WCF methods in Xamarin.Forms (Cross-Platform) dotnet/maui#3024
thanks regards mel
Tagging subscribers to this area: @dotnet/area-system-threading-channels See info in area-owners.md if you want to be subscribed.
I'm able to reproduce the issue, and it appears to be a problem with DNS resolution within the android emulator on my end. Everything works fine when I use the IP address for the WCF service.
Regarding the code snippet:
IPHostEntry hostEntry = Dns.GetHostEntry("service-host-name");
It throws the following error:
System.Net.Sockets.SocketException
Message=hostname nor servname provided, or not known
So, this doesn't seem to be a problem with the WCF product.
Description
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
8.0.40 SR5
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response