none
Problem deploying app with sqlite

    Soru

  • 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

    09 Ekim 2010 Cumartesi 09:24

Yanıtlar

  • 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!
    • Yanıt Olarak İşaretleyen Avi_h 15 Ekim 2010 Cuma 08:59
    14 Ekim 2010 Perşembe 03:11

Tüm Yanıtlar

  • 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
    12 Ekim 2010 Salı 17:43
  • That was the first thing I did.
    It didn't help.
    13 Ekim 2010 Çarşamba 07:32
  • 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
    13 Ekim 2010 Çarşamba 11:24
  • 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!
    • Yanıt Olarak İşaretleyen Avi_h 15 Ekim 2010 Cuma 08:59
    14 Ekim 2010 Perşembe 03:11
  • 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.

     

    15 Ekim 2010 Cuma 08:08
  • Update,

     

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

     

    Thanks

    Avi

    15 Ekim 2010 Cuma 08:59
  • 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

    07 Mart 2012 Çarşamba 22:51