Website Domain Registration and Website Hosting - Host a Website Tonight
GoWebsite.com provides Domain Registration
Website Hosting, On-Line Shopping Carts, SEO
Blog Hosting, Email Accounts, Security Certificates,
Merchant Accounts & other Website Products.
Free setup! Speak with us anytime: 480-624-2500

How do I recompile the MySQL library to run under medium trust?

We have configured the .NET 2.0 environment to run in a customized medium trust environment. The MySQL libraries must be modified to run under this environment. This article describes how to recompile the MySQL/Connector library to run under this version of medium trust.

  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.

Domain Registration Domain Registration
Pay less for website domain names. Register your own .com, .net or .org for as low as $10.18 per year. Everything you need to get online - FREE with your domain.
Website Hosting Website Builder
For as little as $3.89 per month you can build your Website online with Website Builder using our easy to use professional templates.
Play Video - Demo
Shopping Cart Software Quick Shopping Cart
Build and run your own successful online store in minutes! You're just five easy steps away!
Play Video
Website Hosting Website Hosting
Everything you need to give your Website the high-performance home it deserves!  Protect transactions and customer data with a
SSL Certificate