Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
365 views
in Technique[技术] by (71.8m points)

system.data.sqlite - C# Failed to find or load the registered .Net Data Provider error

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:

"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"

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"/>

When I looked I didn't even find a machine.config file in the C:WINDOWSMicrosoft.NETFrameworkv3.5 folder but I did find one in the C:WINDOWSMicrosoft.NETFrameworkv2.0.50727

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.

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...