Error using MySql connector with Xamarin
Posted by: Jassim Rahma
Date: June 05, 2018 05:33PM

Hi,

I am trying to use MySql plugin in Xamarin project.

I have added the pliugin to all my PCL projects and the used:

sql_connection = new MySqlConnection("Server=mysql.mydomain.com; Database=mydb; Uid=myuser; Pwd=mypassword;");

try
{
sql_connection.Open();
}
catch (MySqlException ex)
{
DisplayAlert("Error", ex.Message, "Ok");
}


but I am getting below error:

System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.MySqlConfiguration' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Configuration.ClientConfigPaths..ctor (System.String exePath, System.Boolean includeUserConfig) [0x00050] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigPaths.GetPaths (System.String exePath, System.Boolean includeUserConfig) [0x00018] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigurationHost.get_ConfigPaths () [0x0000a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigurationHost.GetStreamName (System.String configPath) [0x0006d] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigurationHost.get_IsAppConfigHttp () [0x00000] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.Internal.DelegatingConfigHost.get_IsAppConfigHttp () [0x00006] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigurationSystem..ctor () [0x00051] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem () [0x00024] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem () [0x00060] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ConfigurationManager.PrepareConfigSystem () [0x0000a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x0000a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at MySql.Data.MySqlClient.MySqlConfiguration..cctor () [0x00000] in <575e720ed6c440559324a6291091586f>:0
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.Replication.ReplicationManager..cctor () [0x0001e] in <575e720ed6c440559324a6291091586f>:0
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.MySqlConnection.Open () [0x000b9] in <575e720ed6c440559324a6291091586f>:0

Options: ReplyQuote


Subject
Written By
Posted
Error using MySql connector with Xamarin
June 05, 2018 05:33PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.