C#无法找到或加载注册.NET数据提供程序错误 [英] C# Failed to find or load the registered .Net Data Provider error

查看:305
本文介绍了C#无法找到或加载注册.NET数据提供程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的SQLite和 http://sqlite.phxsoftware.com/ 包装,当我一个数据源添加到项目中,我得到的错误:

I am using SQLite and the wrapper from http://sqlite.phxsoftware.com/ and when I add a data source to my project I get the error:

一些更新命令不能自动生成,数据库返回以下错误:未能找到或加载注册.NET Framework数据提供者

"Some updating commands could not be generated automatically, the database returned to the following error: Failed to find or load the registered .Net Framework data provider"

我有最新的.Net服务包,我已经卸载并重新安装SQLite的软件。我也看了其他地方这表明此条目不Machine.config文件:

I have the latest .Net service pack and I have uninstalled and reinstalled the SQLite software. I have also looked other places which suggest this entry is not in the machine.config file:

  <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.27.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>

当我看着我甚至没有发现在C machine.config文件:\WINDOWS \Microsoft.NET\Framework\v3.5文件夹,但我没有找到一个在C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

When I looked I didn't even find a machine.config file in the C:\WINDOWS\Microsoft.NET\Framework\v3.5 folder but I did find one in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

没有人有任何想法是怎么回事?我是否需要卸载整个.Net框架,然后只需安装3.5版只是为了得到这个错误消失?

Does anyone have any idea what is going on? Do I need to uninstall the entire .Net Framework and then just install the 3.5 version just to get this error to go away?

任何帮助,将不胜感激。

Any help would be appreciated.

感谢。

推荐答案

您可以添加一个直接引用System.Data这。 SQLite的在应用程序和实例SQLiteFactory?

Can you add a direct reference to System.Data.SQLite in your application and instantiate SQLiteFactory?

我们使用SQLite直接在我们的应用程序的bin主任(不是GAC)中的dll并且在我们的Web /应用程序这一行。配置所以我们不会依靠的Machine.config(简化了部署)

We use SQLite with the dll directly in our app's bin director (not the GAC) and have this line in our Web/App.config so we're not relying on Machine.config (eases deployment).

<system.data>
	<DbProviderFactories>
		<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
	</DbProviderFactories>
</system.data>

这篇关于C#无法找到或加载注册.NET数据提供程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆