title: MySql with asp.net have error
body: <p>Help me access the mysql database. There is a connection, but there is another error.I can not connect to the database (local). Error:</p>
  
  <pre><code>Server Error in Application '/'.
  Method "MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(System.Data.Common.DbConnection)" could not access the method "MySql.Data.MySqlClient.MySqlConnection.get_Settings()".
  
  Description: An unhandled exception occurred during the execution of the current web request. Examine the stack trace for more information about this error and the code snippet that caused it. 
  
  Exclusion Information: System.MethodAccessException: Method "MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(System.Data.Common.DbConnection)" could not access the method "MySql.Data.MySqlClient.MySqlConnection.get_Settings()".
  </code></pre>
  
  <p>Trace the stack:</p>
  
  <pre><code>[MethodAccessException: Методу "MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(System.Data.Common.DbConnection)" could not access the method"MySql.Data.MySqlClient.MySqlConnection.get_Settings()".]
     MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +44
     System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +87
  
  [ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
     System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +271
     MySql.Data.Entity.MySqlManifestTokenResolver.ResolveManifestToken(DbConnection connection) +32
     System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest&amp; providerManifest) +56
     System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +43
     System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +62
     System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +123
     System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +627
     System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18
     System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +53
     System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() +15
     System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable&lt;TResult&gt;.GetEnumerator() +53
     System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +375
     System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
     WebApplication2.Controllers.HomeController.Index() in C:\Users\shebanits.vitaliy\source\repos\WebApplication2\WebApplication2\Controllers\HomeController.cs:24
     lambda_method(Closure , ControllerBase , Object[] ) +62
     System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
     System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +157
     System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
     System.Web.Mvc.Async.&lt;&gt;c.&lt;BeginInvokeSynchronousActionMethod&gt;b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
     System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29
     System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
     System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
     System.Web.Mvc.Async.AsyncInvocationWithFilters.&lt;InvokeActionMethodFilterAsynchronouslyRecursive&gt;b__11_0() +50
     System.Web.Mvc.Async.&lt;&gt;c__DisplayClass11_1.&lt;InvokeActionMethodFilterAsynchronouslyRecursive&gt;b__2() +228
     System.Web.Mvc.Async.&lt;&gt;c__DisplayClass7_0.&lt;BeginInvokeActionMethodWithFilters&gt;b__1(IAsyncResult asyncResult) +10
     System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
     System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
     System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
     System.Web.Mvc.Async.&lt;&gt;c__DisplayClass3_6.&lt;BeginInvokeAction&gt;b__3() +35
     System.Web.Mvc.Async.&lt;&gt;c__DisplayClass3_1.&lt;BeginInvokeAction&gt;b__5(IAsyncResult asyncResult) +100
     System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
     System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
     System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
     System.Web.Mvc.&lt;&gt;c.&lt;BeginExecuteCore&gt;b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +11
     System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
     System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
     System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +45
     System.Web.Mvc.&lt;&gt;c.&lt;BeginExecute&gt;b__151_2(IAsyncResult asyncResult, Controller controller) +13
     System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
     System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
     System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
     System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
     System.Web.Mvc.&lt;&gt;c.&lt;BeginProcessRequest&gt;b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +28
     System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
     System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
     System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
     System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
     System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9748665
     System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +159
  </code></pre>
  
  <p>I understand that I can not connect to the database, but I do not understand what the error is, tell me. Here is the code ...</p>
  
  <p>web.config</p>
  
  <pre><code> &lt;entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6"&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /&gt;
      &lt;providers&gt;
        &lt;provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" /&gt; 
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
    &lt;connectionStrings&gt;
      &lt;add name="conn" providerName="MySql.Data.MySqlClient"
           connectionString="server=127.0.0.1;uid=root;Password=Accessdeniedroma2005;database=musicportal;CharSet=utf8;Persist Security Info=False;Integrated Security=true" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Model with contex:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Data.Entity;
  using System.Linq;
  using System.Web;
  
  namespace WebApplication2.Models
  {
      public class User
      {
          public int id { get; set; }
          public string login { get; set; }
          public string password { get; set; }
          public string username { get; set; }
      }
  
      [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]
      public class UsersContext : DbContext
      {
          public UsersContext() : base("conn")
          {  }
  
          public DbSet&lt;User&gt; Users { get; set; }
      }
  }
  </code></pre>
  
  <p>and part of the controller::</p>
  
  <pre><code>private UsersContext dbUsers = new UsersContext();
          public ActionResult Index()
          {
              //string connectionString = @"Data Source=localhost; Database = musicportal; User ID = root; Password = Accessdeniedroma2005;SslMode=none";
              //using (MySqlConnection cn = new MySqlConnection(connectionString))
              //{
              //    cn.Open();
              //    Response.Write("Подключился!");
              //}
  
              return View(dbUsers.Users.ToList());
          }
  </code></pre>