I created a connection class for my application in Xamarin, but every time I try to connect it throws this exception:
"The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception "
Follow the example code
private static MySqlConnection _conexao = new MySqlConnection();
public void Conectar()
{
_conexao.ConnectionString = string.Format("server={0};database={1};uid={2}; pwd={3}", Server, Database, Usuario, Senha);
try
{
_conexao.Open();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
Does anyone know what it can be? The information passed from server, database, user and password, are correct, already checked.