System.Data.SQLite
View Ticket
Not logged in
Ticket UUID: f37ca75121aa984b65b46de6bfbe589143b378e1
Title: EF6 Model-First SQL code generation error!
Status: Deferred Type: Feature_Request
Severity: Important Priority: Medium
Subsystem: NuGetPackage Resolution: Under_Review
Last Modified: 2015-06-03 02:37:18
Version Found In: 1.0.94.1
User Comments:
anonymous added on 2014-10-06 13:21:47:

Hi.
I am a freelancer (ASP.NET Developer) and recently, I have installed SQLite 3.8.6 (x86/x64) for research purposes.
I use Microsoft Visual Studio 2013 Ultimate + Update 3.
When I try to generate SQL code from EDMX model, after setting up the connection, generating wizard shows me this error:

----------
...
Running transformation: System.InvalidOperationException: 
The SSDL generated by the activity called 'CsdlToSsdlAndMslActivity' is not valid and has the following errors: 
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SQLite.EF6'. 
Make sure the provider is registered in the 'entityFramework' section of the application config file. 
See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
...
----------

My App.config file content _that configured by Nuget Package Manager_ is:
----------
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <system.data>
    <!--
        NOTE: The extra "remove" element below is to prevent the design-time
              support components within EF6 from selecting the legacy ADO.NET
              provider for SQLite (i.e. the one without any EF6 support).  It
              appears to only consider the first ADO.NET provider in the list
              within the resulting "app.config" or "web.config" file.
    -->
    <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" />
      <remove invariant="System.Data.SQLite" />
      <remove invariant="System.Data.SQLite.EF6" />
      <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
    </DbProviderFactories>
  </system.data>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
    </providers>
  </entityFramework>
</configuration>
----------
Please tell me:
1- Does SQLite EF6 Provider support Model-First approach? (If Yes, What should I do to resolve this situation?)
2- Are you sure about internal accessibility of System.Data.SQLite.EF6.SQLiteProviderServices?

Thanks to your consideration.


mistachkin added on 2014-10-06 17:23:39:
Answers to your questions:

1. I think it should.
2. Yes.

Please try removing the following line from your "app.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" />

anonymous (claiming to be arash.laylazi@live.com) added on 2014-10-06 19:04:25:

I have tried your solution, but the error still exists.(attachment: error.gif)
I think default [SSDT to SQL T4 Template] is not compatible to SQLite.
Is there any official [SSDT to SQLite T4 Template] that does sql code generation?


mistachkin added on 2014-10-07 00:35:31:
If it requires a special template, then System.Data.SQLite does not currently
support this scenario.

Changing to feature request.

anonymous added on 2015-06-03 02:37:18:
Any update on this?  I'm also seeing this error.

Attachments: