Home > Back-end >  Why does AmazonCognitoIdentityProviderClient deadlock in C# Xamarin?
Why does AmazonCognitoIdentityProviderClient deadlock in C# Xamarin?

Time:11-24

I have used the aws-samples example named aws-cognito-dot-net-desktop-app in C# and WPF in a Windows PC application:

deadlock

No exception or some other type of error occurs.

Is there a way to find out with Visual Studio what is happening?

Any comment or suggestion is welcome.

UPDATE

The way I call SignUpUser is like this:

private async void clickCreateUser(object o, EventArgs e)
{
   ...
   try
   {

      CognitoHelper helper = new CognitoHelper();
      bool success = await helper.SignUpUser(etUserName.Text, etPasswordUser.Text, etEmailUser.Text, etPhoneUser.Text);
      ...

   }
   catch (Exception ex)
   {
    Android.Widget.Toast.MakeText(Application.Context, "Error: "   ex.Message, Android.Widget.ToastLength.Long).Show();
   }
}

UPDATE2

I got an example for Xamarin. Forms of this link:

enter image description here

I need to keep going through the rest of the code to determine other possible issues

CodePudding user response:

The solution is to set the AWS region that is being used, as follows:

Amazon.CognitoIdentityProvider.AmazonCognitoIdentityProviderClient provider = new Amazon.CognitoIdentityProvider.AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), RegionEndpoint.YourRegionAWS);
  • Related