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!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Fark
  • Furl
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Spurl

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

Required

Required, hidden

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


Calendar

July 2008
M T W T F S S
« Feb    
 123456
78910111213
14151617181920
21222324252627
28293031  

Most Recent Posts



Join the Blue Ribbon Online Free Speech Campaign
Join the Blue Ribbon Online Free Speech Campaign!