Calling MySQL .NET Provider from Partially Trusted Code
March 19th, 2006
Many Web Hosts are facing this issue of trying to provide access to MySQL .NET provider from medium trust or custom trust code. For example using MySQL.Data objects in ASP.NET 2 from partially trusted code results in the following error. Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers. The solution to get around this problem is easy because the source code of MySQL .NET provider is included in the download. The following steps need to be followed.
- Locate AssemblyInfo.cs and open it in your favorite editor.
- Add [assembly:AllowPartiallyTrustedCallers] at an appropriate place in the file and save it.
- Recompile and Re-Deploy MySQL.Data.dll
Good Luck!
Entry Filed under: System Administration











1 Comment Add your own
1. Noman Dormosh | July 8th, 2006 at 12:25 pm
This is really cool and useful Nasir.
Gr8 job
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed