Site publishing issues

I recently started experimenting with ASP.NET MVC and Entity Framework. Since my hosting provider only provides MySQL, I tried to set it up. Locally, everything works fine, but after publishing, I get the following error:

[ProviderIncompatibleException: The store provider factory type 'MySql.Data.MySqlClient.MySqlClientFactory' does not implement the IServiceProvider interface. Use a store provider that implements this interface.]

Since I'm pretty inexperienced with setting this up and google lacks a good answer, I thought I would try it here. My best guess is that something is missing from the web.config file, but cannot figure out what it is.

Any help would be greatly appreciated!

+3
source share
4 answers

I think I found a solution. a) I have to add the provider to my web.config:

  <system.data>
    <DbProviderFactories>
      <clear />
      <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.0.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>

b) MySQL DLL ( ), , :

  • mysql.web.dll
  • mysql.data.entity.dll
  • mysql.data.dll
  • mysql.data.cf.dll

c) -, " " true.

d) , web.config dll

, 8 ( , ), , , , EDIT: works:)

+3

(mysql, - , VS2008, MySql Connector 6.1.3.0). , . , , , .

-, , . dbFactories DLL BIN, GAC.

-, msl, ssdl, csdl ( , Windows "copy to output directory" ). APP_DATA -.

- . , "quot" ? .

name= "classEntities" connectionString = "metadata = ~\App_Data\Model.csdl | ~\App_Data\Model.ssdl | ~\App_Data\Model.msl; = MySql.Data.MySqlClient; = 'server = hostServer; user id = myUsername; password = myPassword; database = schema'" providerName = "System.Data.EntityClient"

, -, - , .

+1

, , MySql.Data.dll bin, , mysql.data.msi , -. , bin.

mysql.data.msi MySql.Data.dll bin .

Habibullah.hameed@yahoo.com

+1

: "mysql.web.dll", "mysql.data.entity.dll", "mysql.data.dll" "bin" "root-www" Host.

: "mysql.data.cf.dll" , , "bin".

0
source

Source: https://habr.com/ru/post/1717959/


All Articles