MySQL 错误 175:找不到指定的数据存储提供程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4444742/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error 175: The specified data store provider cannot be found
提问by Walt Stoneburner
I'm using VS2010 with the MySQL .NET Connector. My project that used to work started reporting:
我将 VS2010 与MySQL .NET Connector 一起使用。我曾经工作的项目开始报告:
Error 175: The specified data store provider cannot be found, or is not valid.
错误 175:找不到指定的数据存储提供程序或无效。
I don't know why, though things got weird after a MS recommended hotfix to VS.
我不知道为什么,尽管在 MS 向 VS 推荐修补程序后事情变得很奇怪。
Sure enough, if I go to add a test ADO.NET Entity Data Model to the project, the Entity Data Model Wizard that generates the .edmx file does not show the data provider when I select 'Generate from database'. Worse yet, right-clicking and attempting to do an 'Update Model from Database...' on an existing .edmx file sends VS2010 into a death spiral of dialog boxes that can only be terminated with Task Manager.
果然,如果我去向项目添加测试 ADO.NET 实体数据模型,当我选择“从数据库生成”时,生成 .edmx 文件的实体数据模型向导不会显示数据提供程序。更糟糕的是,右键单击并尝试在现有的 .edmx 文件上执行“从数据库更新模型...”会将 VS2010 发送到对话框的死亡螺旋中,该对话框只能通过任务管理器终止。
Here's how I fix it: Shutdown VS2010. Uninstall the MySQL Connector completely. Reboot. Install the MySQL Connector completely. Reboot. Restart VS2010.
这是我修复它的方法:关闭 VS2010。完全卸载 MySQL 连接器。重启。完全安装 MySQL 连接器。重启。重启VS2010。
Suddenly, my data provider exists. I can compile my code. As well as add test .edmx files. The wizard sees my MySQL database, passes the test connection, and builds object models with my relational tables. I can clean/rebuild as much as I want.
突然间,我的数据提供者存在了。我可以编译我的代码。以及添加测试 .edmx 文件。向导查看我的 MySQL 数据库,通过测试连接,并使用我的关系表构建对象模型。我可以随心所欲地清理/重建。
All's good until I run the app. My "fix" doesn't stick.
一切都很好,直到我运行该应用程序。我的“修复”没有坚持。
At that point an exception is thrown stating that the connection object is returning null, and if I recompile with no code changes, I get the Error 175 error again. Lather, rinse, repeat.
此时会抛出一个异常,指出连接对象正在返回 null,如果我在没有代码更改的情况下重新编译,我将再次收到 Error 175 错误。起泡,冲洗,重复。
Some experiments based off of this StackOverflow answer, show that the Connection String is valid, and using the MySqlConnection object, I can access the database and roll my own working queriesin this state.
基于此 StackOverflow answer 的一些实验表明Connection String 是有效的,并且使用 MySqlConnection 对象,我可以访问数据库并在这种状态下滚动我自己的工作查询。
The problem seems to be that the data store provider is somehow getting lost or stepped on, and this is impacting the ability to do things through EntityFrameworks.
问题似乎是数据存储提供者不知何故迷路或被踩到,这影响了通过 EntityFrameworks 做事的能力。
I'm looking for some advice on where to look for these being stored, if anyone has run across something similar, and if there's any useful suggestions or ideas you think I might try.
我正在寻找一些关于在哪里寻找这些存储的建议,如果有人遇到过类似的事情,以及是否有任何有用的建议或想法你认为我可以尝试。
UPDATE-- While this tidbit did not solve my problem, it did make VS2010 more stable: Immediately after uninstalling of the .NET Connector, I checked under Control Panel's installed programs and found there was an older .NET Connector installed as well. I uninstalled that one from the control panel, rebooted, and theninstalled the new one. VS2010 now remembers the database provider for working with EntityFrameworks. Apparently I installed a newer MySQL Connector thinking it would uninstall the old one, instead they step all over each other.
更新——虽然这个花絮没有解决我的问题,但它确实使 VS2010 更加稳定:卸载 .NET 连接器后,我立即检查控制面板的已安装程序,发现还安装了旧的 .NET 连接器。我从控制面板卸载了那个,重新启动,然后安装了新的。VS2010 现在记住了用于处理 EntityFrameworks 的数据库提供程序。显然我安装了一个较新的 MySQL 连接器,认为它会卸载旧的连接器,而不是它们相互交错。
Now I'm getting a System.ArgumentException
inside System.Data.Entity.dll
stating the slightly different message:
现在我得到一个System.ArgumentException
内部System.Data.Entity.dll
消息,说明略有不同的消息:
The specified store provider cannot be found in the configuration, or is not valid. System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
在配置中找不到指定的商店提供程序,或者指定的商店提供程序无效。System.ArgumentException: 无法找到请求的 .Net Framework 数据提供程序。它可能没有安装。
This happens at the System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
method.
这发生在System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
方法中。
REVISION NOTE-- The reason for the strike-outs above is that VS2010 eventually did lose the settings again. But I was able to uninstall the .Net Connector from the control panel and reinstall the connector again, without a reboot, and got my data provider back again in the environment. This part of the problem is feeling more like a VS2010 bug than a .NET Connector issue.
修订说明——上述三振出局的原因是 VS2010 最终确实再次丢失了设置。但是我能够从控制面板卸载 .Net 连接器并再次重新安装连接器,而无需重新启动,并使我的数据提供程序再次回到环境中。这部分问题感觉更像是 VS2010 错误而不是 .NET 连接器问题。
采纳答案by Walt Stoneburner
The problem went away after significant updates -- it appeared it was an environment/driver bug after all.
问题在重大更新后消失了——毕竟它似乎是一个环境/驱动程序错误。
回答by DefenestrationDay
回答by Lee
I just restarted my VS2010,and the error just went away!!
我刚刚重新启动了我的 VS2010,错误就消失了!!
回答by Highstead
I came across this error recently and after much restarting / reinstalling it turned out the issue was actually that the 'connector' user had insufficient privledges on a view.
我最近遇到了这个错误,经过多次重新启动/重新安装后,结果发现问题实际上是“连接器”用户对视图的权限不足。
回答by Andrii Nemchenko
I fix error simply by restarting the IDE.
我只需重新启动 IDE 即可修复错误。
回答by Shiraz Bhaiji
Based on some of the comments on the net this could be related to the provider not being in the GAC.
根据网络上的一些评论,这可能与提供商不在 GAC 中有关。
It could also be that an old version is the GAC.
也可能是旧版本是 GAC。
Check what is in the GAC, add the dll to the GAC if it is missing. Restart the machine after any changes in the GAC.
检查 GAC 中的内容,如果缺少 dll,请将其添加到 GAC。在 GAC 中的任何更改后重新启动计算机。