gpt4 book ai didi

c# - 不变名称为 'MySql.Data.MySqlClient' 的 ADO.NET 提供程序未在计算机或应用程序配置文件中注册

转载 作者:行者123 更新时间:2023-11-29 15:31:26 27 4
gpt4 key购买 nike

当我在我的电脑上执行此操作时,我的程序工作正常,但是当其他人尝试在他们的电脑上打开它时,它将打开第一页,但当他们单击“登录”时,程序可能需要开始使用数据库他们收到此错误

enter image description here

我重新安装连接器,执行 PM>Install-Package EntityFramework 并尝试检查 app.config,但对我来说它看起来不错。我还有 EntityFramework.SqlServer.dll - copy Local - true 这应该是正确的。

这是我的应用程序配置


<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<connectionStrings>
<add name="Database" connectionString="metadata=res://*/DatabaseModel.csdl|res://*/DatabaseModel.ssdl|res://*/DatabaseModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=XXX;user id=XXX;password=XXX;persistsecurityinfo=True;database=XXX;allowuservariables=True&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDatabaseModelConnectionFactory, EntityFramework">
<parameters>
<parameter value="v13.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.17.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
</providers>
</entityFramework>
<system.data>
</system.data>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.17.0" newVersion="8.0.17.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

最佳答案

他们的计算机上可能没有安装任何 MySql 连接器。通过安装 nuget 修复它:MySql.ConnectorNET.Entity

enter image description here

关于c# - 不变名称为 'MySql.Data.MySqlClient' 的 ADO.NET 提供程序未在计算机或应用程序配置文件中注册,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58697929/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com