How do I Recompile the MySQL Library to Run Under the Medium Trust Environment in ASP.NET?


Update: You no longer need that if you use the MySQL Connector/Net 5.2 or later.

  1. Download the source code for the MySQL Connector/Net from www.mysql.com.
  2. Extract the contents of the zip file to a local directory.
  3. Open mysql.csproj project file in Visual Studio.
  4. Open the AssemblyInfo.cs file, and add the following code, in the using block, at the top of the file (if it is not already there):using System.Security;
  5. Add the following code to the assembly section of the file:[assembly: AllowPartiallyTrustedCallers]
  6. Recompile the dll.

You may now reference this dll from other projects. When you decide to publish your project to your hosting server, you need to upload this modified version of the dll to your bin directory.

Via How do I Recompile the MySQL Library to Run Under the Medium Trust Environment? – Help Center—Knowledge Base and FAQ

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s