Unexpected connection type Devart.Data.MySql.MySqlConnection

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
kstough93
Posts: 6
Joined: Sat 16 Jul 2016 02:22

Unexpected connection type Devart.Data.MySql.MySqlConnection

Post by kstough93 » Sat 18 Mar 2017 00:03

I have created an application that works fine on my development machine, but when I have installed to the production machine, I'm getting the following stacktrace:

Server Error in Application.

Unexpected connection type Devart.Data.MySql.MySqlConnection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Unexpected connection type Devart.Data.MySql.MySqlConnection.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: Unexpected connection type Devart.Data.MySql.MySqlConnection.]
Devart.Data.MySql.Entity.MySqlEntityProviderServices.GetDbProviderManifestToken(DbConnection connection) +328
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +116

[ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +377
System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +24

[ProviderIncompatibleException: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. See the inner exception for details of the failure.]
System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +101
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +84
System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest) +89
System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +63
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +91
System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +227
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +878
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +25
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +77
System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() +21
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +432
System.Linq.Enumerable.ToList(IEnumerable`1 source) +70
InterlincAPI.Controllers.LocationsController.Index() +34
lambda_method(Closure , ControllerBase , Object[] ) +87
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +209
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +67
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +30
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +186
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +44
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0

This is an ASP.NET MVC application using Entity Framework 6, .NET 4.6 and the latest dotConnect MySQL with a 5.7 MySQL database. I have verified the following:

- MySQL has been configured and I can access it with the connection string specified in my web.config.
- Confirmed the licenses.licx file has been properly created and compiled with the project when I publish.
- Verify connection strings for MySQL are set up correctly in the machine.config files.
- Performed a minimal installation of dotConnect MySQL on the target machine.

Has anyone else this issue, I'm sure it something with my deployment and/or the target machine set up, but not sure what to check next.

Thanks,
Kevin

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Unexpected connection type Devart.Data.MySql.MySqlConnection

Post by Shalex » Mon 20 Mar 2017 14:09

kstough93 wrote:Verify connection strings for MySQL are set up correctly in the machine.config files.
1. Please make sure that your application *.config includes the following entries:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <providers>
      <provider invariantName="Devart.Data.MySql" type="Devart.Data.MySql.Entity.MySqlEntityProviderServices, Devart.Data.MySql.Entity.EF6, Version=8.8.862.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.MySql" />
      <add name="dotConnect for MySQL" invariant="Devart.Data.MySql" description="Devart dotConnect for MySQL" type="Devart.Data.MySql.MySqlProviderFactory, Devart.Data.MySql, Version=8.8.862.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>
Replace 8.8.862.0 here with your actual version.
kstough93 wrote:Performed a minimal installation of dotConnect MySQL on the target machine.
2. Either install "Minimal installation" plus "Entity Framework support" or copy Devart.Data.dll, Devart.Data.MySql.dll, Devart.Data.MySql.Entity.EF6.dll to the folder with your application *.exe file.

Does this help?

Post Reply