Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

Problem with MySQL connector in medium trust (no replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 1447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>