none
Problem deploying app with sqlite RRS feed

  • Question

  • Hi,

    I've developed a small winform app that uses sqlite with entity framework.

    for it to work I've installed sqlite ado.net provider from here . everything works on my dev machine with VS2008.

    When I deploy it to a clean windows 7 with .net 3.5.1 and the provider I get the following error:

    ---------------------------

    ---------------------------
    System.ArgumentException: 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.

       at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)

       at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)

       --- End of inner exception stack trace ---

       at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)

       at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)

       at System.Data.EntityClient.EntityConnection..ctor(String connectionString)

       at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)

       at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)

       at Lib.StoreEntities..ctor() in C:\Documents and Settings\aharush.VOGATECH\My Documents\Visual Studio 2008\Projects\StoreManager\Lib\Store.Designer.cs:line 26

       at Lib.ContextManager..ctor() in C:\Documents and Settings\aharush.VOGATECH\My Documents\Visual Studio 2008\Projects\StoreManager\Lib\ContextManager.cs:line 14

       at StoreManager.frmMain..ctor() in C:\Documents and Settings\aharush.VOGATECH\My Documents\Visual Studio 2008\Projects\StoreManager\StoreManager\frmMain.cs:line 29

       at StoreManager.Program.Main() in C:\Documents and Settings\aharush.VOGATECH\My Documents\Visual Studio 2008\Projects\StoreManager\StoreManager\Program.cs:line 20\

     

    my app config is:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <connectionStrings>
        <add name="StoreEntities" connectionString="metadata=res://*/Store.csdl|res://*/Store.ssdl|res://*/Store.msl;provider=System.Data.SQLite;provider connection string='data source=&quot;C:\Users\user1\Documents\Store.s3db&quot;'" providerName="System.Data.EntityClient" />
      </connectionStrings>
     
    </configuration>

     

    Thanks

    Avi

    Saturday, October 9, 2010 9:24 AM

Answers

  • Hello,

    Did you run the sample query project downloaded here?

    If that the case, I think you need to add a section in <DbProviderFactories> and specify the type of the provider there.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by Avi_h Friday, October 15, 2010 8:59 AM
    Thursday, October 14, 2010 3:11 AM

All replies

  • Database provider for SQLite is not part of .NET Framework and when you deploy your application you also need to install SQLite provider on target computer. Did you install it?


    Val Mazur (MVP) http://www.xporttools.net
    Tuesday, October 12, 2010 5:43 PM
    Moderator
  • That was the first thing I did.
    It didn't help.
    Wednesday, October 13, 2010 7:32 AM
  • But did you install it using installer or just copied DLL files? If you copied files, it may not be enough.
    Val Mazur (MVP) http://www.xporttools.net
    Wednesday, October 13, 2010 11:24 AM
    Moderator
  • Hello,

    Did you run the sample query project downloaded here?

    If that the case, I think you need to add a section in <DbProviderFactories> and specify the type of the provider there.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by Avi_h Friday, October 15, 2010 8:59 AM
    Thursday, October 14, 2010 3:11 AM
  • Well, after pasting :

    <configuration>
      <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>
      </system.data>
    </configuration>

    I get a different error

    System.Data.ProviderIncompatibleException: A null was returned after calling the 'GetService' method on a store provider instance of type 'System.Data.SQLite.SQLiteFactory'. The store provider might not be functioning correctly.

     

    Friday, October 15, 2010 8:08 AM
  • Update,

     

    Problem solved, I had to add sqlite.desiner + linq to the folder + the configuration section from above.

     

    Thanks

    Avi

    Friday, October 15, 2010 8:59 AM
  • Hey Avi,

    I have been trying to setup a service using SQLite.

    I have a database(SQLite) and used Entity data model. Using LINQ to populate data.

    In app.config file

    <add name="SamproLogEntities" connectionString="metadata=res://*/SamproLog.csdl|res://*/SamproLog.ssdl|res://*/SamproLog.msl;provider=System.Data.SQLite;provider connection string='data source=&quot;SamproLog&quot;'" providerName="System.Data.EntityClient" />


    Name of database SamproLog and datamodel is SamproLogEntities. I am putting

    SQLite.Designer.dll

    System.Data.SQLite.Linq.dll

    System.Data.SQLite.dll

    in same folder with .exe and .exe.config

    I tried to add configuration section posted by you, but It didn't make any sense to me. I am having problem in understanding providerName, I want to understand how does it work. And I am still getting error message that "System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid". Please let me know if you know something here which can help me.

    Thanks

    Wednesday, March 7, 2012 10:51 PM