Last post Apr 21, 2012 09:24 PM by Lannie
Apr 20, 2012 04:26 AM|felixdpg|LINK
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 (with the connection of the webconfig) the connection to my mysql DB work fine. 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);
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.
Apr 20, 2012 04:28 AM|Shoaib Rashid|LINK
Apr 20, 2012 04:32 AM|felixdpg|LINK
Are you sure that is the solution?,
you had the same problem?
Thanks and Regards
Apr 21, 2012 09:24 PM|Lannie|LINK
Use Full Trust in your IIS settings.