SOLVED MySQL connector with ENTITY FRAMEWORK WORKING in Medium Trust hosting environments
First I'm going to show you how I finally used the Entity Framework in a Shared Web Hosting Trust Level . And at the end, I will let off the things I worked so hard. My environment: Mysql version was something 5.6.35-81.0-log .NET framework 4.0 Visual Studio Community 2017 Shared Web Hosting Trust Level = Medium Follow the steps to you finally publish successfully your application: Install the mysql-connector-net-6.3.9 ( download ) Install the mysql-for-visualstudio-1.2.8 ( download ) Reference the 4 mysql dlls in your project mysql.data.dll ( download ) mysql.data.entity.dll ( download ) mysql.visualstudio.dll ( download ) mysql.web.dll ( download ) Go to your project Properties > AssemblyInfo.cs and add the 2 assemblies: [assembly: SecurityRules(SecurityRuleSet.Level1)] [assembly: System.Security.AllowPartiallyTrustedCallers] Make sure your webconfig file has the following lines: <system.data> <DbProviderFactories> <c