错误175:找不到指定的数据存储提供程序

发布于 2024-10-08 02:58:26 字数 1892 浏览 0 评论 0原文

我将 VS2010 与 MySQL .NET 连接器 一起使用。我曾经工作过的项目开始报告:

错误 175:找不到指定的数据存储提供程序,或指定的数据存储提供程序无效。

我不知道为什么,尽管在 MS 推荐对 VS 进行修补程序后事情变得很奇怪。

果然,如果我向项目添加测试 ADO.NET 实体数据模型,当我选择“从数据库生成”时,生成 .edmx 文件的实体数据模型向导不会显示数据提供程序。更糟糕的是,右键单击并尝试对现有 .edmx 文件执行“从数据库更新模型...”会使 VS2010 陷入对话框的死亡螺旋,只能使用任务管理器终止。

修复方法如下:关闭 VS2010。完全卸载 MySQL 连接器。重新启动。完全安装 MySQL 连接器。重新启动。重新启动VS2010。

突然间,我的数据提供者出现了。我可以编译我的代码。以及添加测试 .edmx 文件。该向导会看到我的 MySQL 数据库,通过测试连接,并使用我的关系表构建对象模型。我可以根据需要进行清理/重建。

一切都很好,直到我运行该应用程序。我的“修复”不起作用。

此时会引发异常,表明连接对象返回 null,如果我在不更改任何代码的情况下重新编译,则会再次收到 Error 175 错误。起泡沫,冲洗,重复。

一些基于此 StackOverflow 答案的实验表明< strong>连接字符串有效,并且使用 MySqlConnection 对象,我可以在此状态下访问数据库并滚动我自己的工作查询

问题似乎是数据存储提供者不知何故迷路或被踩到,这影响了通过 EntityFrameworks 执行操作的能力。

我正在寻找一些关于在哪里寻找这些存储的建议,如果有人遇到过类似的事情,以及您认为我可能会尝试的任何有用的建议或想法。  

更新 - 虽然这个花絮没有解决我的问题,它确实使 VS2010 更加稳定:卸载 .NET Connector 后,我立即在控制面板的已安装程序下进行检查,发现还安装了一个较旧的 .NET 连接器。我从控制面板卸载了那个,重新启动,然后安装了新的。 VS2010 现在会记住用于 EntityFrameworks 的数据库提供程序。显然,我安装了一个较新的 MySQL 连接器,以为它会卸载旧的连接器,而不是它们互相踩踏。

现在,我在 System.Data.Entity.dll 中收到一个 System.ArgumentException ,说明了略有不同的消息:

在配置中找不到指定的存储提供程序,或者指定的存储提供程序无效。 System.ArgumentException:无法找到请求的.Net Framework 数据提供程序。 可能没有安装。

这发生在 System.Data.Common.DbProviderFactories.GetFactory(StringproviderInvariantName) 方法中。

修订说明 -- 上述删除的原因是 VS2010 最终再次丢失了设置。但我能够从控制面板卸载 .Net 连接器并再次重新安装连接器,而无需重新启动,并将我的数据提供程序再次恢复到环境中。这部分问题感觉更像是 VS2010 bug,而不是 .NET Connector 问题。

I'm using VS2010 with the MySQL .NET Connector. My project that used to work started reporting:

Error 175: The specified data store provider cannot be found, or is not valid.

I don't know why, though things got weird after a MS recommended hotfix to 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.

Here's how I fix it: Shutdown VS2010. Uninstall the MySQL Connector completely. Reboot. Install the MySQL Connector completely. Reboot. Restart 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.

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.

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 queries in this state.

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.

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 then installed 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.

Now I'm getting a System.ArgumentException inside System.Data.Entity.dll stating the slightly different message:

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.

This happens at the System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) method.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

蓝礼 2024-10-15 02:58:26

重新安装 Windows 后,我遇到了同样的错误,并且忘记添加 SQlite 的提供程序。
它位于此处,尽管它没有提及,但它完全支持 VS 2010。

I had this same error after reinstalling windows, and forgetting to add the provider for SQlite.
It's here, and even though it doesn't mention it, it supports VS 2010 fully.

回眸一笑 2024-10-15 02:58:26

在重大更新后问题就消失了——看来这毕竟是一个环境/驱动程序错误。

The problem went away after significant updates -- it appeared it was an environment/driver bug after all.

绮烟 2024-10-15 02:58:26

我刚刚重新启动 VS2010,错误就消失了!

I just restarted my VS2010,and the error just went away!!

丿*梦醉红颜 2024-10-15 02:58:26

根据网上的一些评论,这可能与提供商不在 GAC 中有关。

也可能旧版本是 GAC。

检查GAC中有什么,如果缺少,请将dll添加到GAC中。对 GAC 进行任何更改后重新启动计算机。

Based on some of the comments on the net this could be related to the provider not being in the GAC.

It could also be that an old version is the 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.

别再吹冷风 2024-10-15 02:58:26

我最近遇到了这个错误,经过多次重新启动/重新安装后发现问题实际上是“连接器”用户在视图上没有足够的权限。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文