I did a web service and When I execute in DEBUG mode, it works! Enter to the TRY! But in mode RELEASE doesnt! Enter to the CATCH exception Somebody knows why?
try {
MercappEntities.Objeto_Usuario token = client.usuarioLoggeado (probaruser, probarpass);
if(token!=null)
{
var entrada = new Intent (this, typeof(Home));
entrada.AddFlags (ActivityFlags.ClearTop);
entrada.PutExtra ("usuario", token.idUsuario);
entrada.PutExtra ("correo", token.correo);
entrada.PutExtra ("contra", token.contrasena);
entrada.PutExtra("nombre", token.nombre);
StartActivity (entrada);
}
else{
pd.Dismiss ();
AlertDialog.Builder builder2;
builder2 = new AlertDialog.Builder (this);
builder2.SetTitle ("Datos Incorrectos");
builder2.SetMessage ("Datos incorrectos");
builder2.SetCancelable (false);
builder2.SetPositiveButton ("OK", delegate {
CloseContextMenu ();
});
pass.Text = "";
builder2.Show ();
}
} catch (Exception e){
pd.Dismiss ();
AlertDialog.Builder builder;
builder = new AlertDialog.Builder (this);
builder.SetTitle ("Error de conexión");
builder.SetMessage (e.Message);
builder.SetCancelable (false);
builder.SetPositiveButton ("OK", delegate {
CloseContextMenu ();
});
pass.Text = "";
builder.Show ();
}