Calling MySQL .NET Provider from Partially Trusted Code
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!
1 comment March 19th, 2006










