Could not find or download registered .Net Framework data provider

The following error occurred: "Could not find or load the registered .Net Framework data provider." This only happens on the AppHarbor server and not on the local

I am using .Net mvc4 and mysql

I added MySql.Data, MySql.Data.Entity, MySql.Web to reference and set Copy Local = true. I also click the bin folder in AppHarbor

This is my web.config:

<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> </configSections> <system.data> <DbProviderFactories> <remove invariant="MySql.Data.MySqlClient"/> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> </DbProviderFactories> </system.data> <connectionStrings> <add name="fmcdatabaseEntities" connectionString="metadata=res://*/Models.FMCEntityDataModel.csdl|res://*/Models.FMCEntityDataModel.ssdl|res://*/Models.FMCEntityDataModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=****;uid=****;port=3306;database=****&quot;" providerName="System.Data.EntityClient"/> </connectionStrings> <appSettings> <add key="webpages:Version" value="2.0.0.0"/> <add key="webpages:Enabled" value="false"/> <add key="PreserveLoginUrl" value="true"/> <add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/> <add key="enableSimpleMembership" value="false"/> <add key="autoFormsAuthentication" value="false"/> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5"> <assemblies> <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </assemblies> </compilation> <httpRuntime targetFramework="4.5" /> <authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880"/> </authentication> <membership defaultProvider="CustomMembershipProvider"> <providers> <clear/> <add name="CustomMembershipProvider" type="FindMyCrushServer.Controllers.ControllerHelpers.CustomMembershipProvider" connectionStringName="fmcdatabaseEntities" applicationName="FindMyCrushServer" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Clear"/> </providers> </membership> <roleManager defaultProvider="CustomRoleProvider" enabled="true" cacheRolesInCookie="false"> <providers> <clear/> <add name="CustomRoleProvider" type="FindMyCrushServer.Controllers.ControllerHelpers.CustomRoleProvider"/> </providers> </roleManager> <pages> <namespaces> <add namespace="System.Web.Helpers"/> <add namespace="System.Web.Mvc"/> <add namespace="System.Web.Mvc.Ajax"/> <add namespace="System.Web.Mvc.Html"/> <add namespace="System.Web.Optimization"/> <add namespace="System.Web.Routing"/> <add namespace="System.Web.WebPages"/> </namespaces> </pages> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <handlers> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/> </entityFramework> </configuration> 

Any help is really much appreciated. thanks in advance

+5
asp.net-mvc-4 appharbor
source share
4 answers

Have you tried using NuGet packages?

... they need to make sure the right bits go where they are needed. You can use NuGet package recovery to avoid pushing the contents of the package in AppHarbor.

+12
source share

I only saw that the cause of this exception in my case was different versions between the dll and the configuration record.

Thus, sometimes the dll that you have (installed nuget or in another way) is different from writing to node app.config. This section, if not in app.config, can also be found in the section

Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Config \ machine.config and nearby folders.

Changing the version in the record to the version of the DLL solved the problem.

+4
source share

For me, my nuget does not add the necessary DLLs to my / bin project. Thus, copying all missing DLLs from the package folder to the bin folder solves this problem.

+1
source share

Thanks, I think the db provider factories in web.config is a fix

 <system.data> <DbProviderFactories> <remove invariant="MySql.Data.MySqlClient" /> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories> </system.data> 
0
source share

All Articles