2
votes

I developed a windows application using Entity Framework and as a database, I used SQLite. I have no problem developing it until I add a setup project to my solution to make an installer file for my application and I add .net Framework 3.5 and .net Framework 4.0 and Windows Installer as prerequisite to install.

In other computers, installation is done successfully but when users try to execute the application, they receive this exception

Unable to find the requested .Net Framework Data Provider

I googled this exception and most of the answers talked about provider name tag in web.config. Can anyone help me?

1

1 Answers

2
votes

You have to include the System.Data.SQLite.dll provider assembly in your installer package (or make them required in a click-once download app) and then you have to register the provider by adding it to the providers section in the config file.

<system.data>
<DbProviderFactories>
    <remove invariant="System.Data.SQLite"/>
    <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>