enter image description here首先,我要告诉问题是当我将项目发布到IIS Server时,我发现了这样的错误。在本地,我的项目工作正常。
在ADO.NET提供程序的应用程序配置文件中注册的实体框架提供程序类型'MySql.Data.MySqlClient.MySqlProviderServices,MySql.Data.Entity.EF6'不变名称为'MySql.Data.MySqlClient'已加载。确保使用了程序集限定名称,并且该程序集可用于正在运行的应用程序。有关更多信息,请参见http://go.microsoft.com/fwlink/?LinkId=260882。
,连接字符串为:
connectionStrings>
<add name="imoney2Entities" connectionString="metadata=res://*/Models.registrasiFullModel.csdl|res://*/Models.registrasiFullModel.ssdl|res://*/Models.registrasiFullModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=**.**.**.**;user id=***;password=******;database=imoney2"" providerName="System.Data.EntityClient" />
<add name="imoney2Entities1" connectionString="metadata=res://*/Models.RegisterFullModel.csdl|res://*/Models.RegisterFullModel.ssdl|res://*/Models.RegisterFullModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=**.**.**.**;user id=**;password=******;database=imoney2"" providerName="System.Data.EntityClient" />
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
</providers></entityFramework>
Connection String in this line.
<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.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories></system.data>