Problem with MySQL connector in medium trust
Posted by: felix perez
Date: April 19, 2012 03:50PM

Hi All

I have a big problem and i very confuse with mysql connector in medium trust using asp.net. I use the 6.5.4 version of the connector and my dlls are copied in the bin folder of the app (I have a hosting provider that not has the dll of the connector registered in the GAC and run in medium trust)
The problem: I have a simple demo app in asp.net (vs2010) using framework 4 under medium trust. When I use the controls of asp.net and asp.net makes a connection automatically, the connection to my mysql DB work fine, and I can make all operations in the DB. But, when I make the connection manually using this:

MySqlConnectionStringBuilder myconnString = new MySqlConnectionStringBuilder("Server=hostingproviderserver;Database=test;Uid=root;Pwd=test;");
MySqlConnection myconn = new MySqlConnection(myconnString.ConnectionString);
myconn.Open();

I receive a permission error:

"The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file."

The problem is that I use in the same app the two type of connection (manual and automatic) and I receive an error with a manual connection. All this in medium trust, because if I test the app in a full trust environment, the two ways working OK. I need the help of the community.

Thanks and Regards.

Felix

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem with MySQL connector in medium trust
1458
April 19, 2012 03:50PM


Sorry, you can't reply to this topic. It has been closed.

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.