Tôi nhận được lỗi này với gói Nuget cho SQLite 1.0.94.1. Tôi đã chơi đùa với các phần app.config khác nhau, được hỗ trợ bởi các câu hỏi tương tự về các phiên bản trước của gói này, nhưng tôi không thể làm cho nó hoạt động. Dưới đây là app.config khi tôi tìm thấy nó sau khi cài đặt gói Nuget. Tôi đã xóa app.config trước khi cài đặt nó. Tôi chỉ thêm các kết nối sau đó.Không thể xác định tên nhà cung cấp cho nhà máy cung cấp loại 'System.Data.SQLite.SQLiteFactory'. với phiên bản gói Nuget 1.0.94.1
Vì vậy, đâu là vấn đề ??
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<!--Added by me, the rest of the app.config was constructed by installing the SQLite package -->
<connectionStrings>
<add name="PrivateMessengerContext" connectionString="DataSource=|DataDirectory|\PrivateMessengerDb.db" providerName="System.Data.SQLite.EF6"/>
<add name="PasswordContext" connectionString="DataSource=|DataDirectory|\PasswordDb.db" providerName="System.Data.SQLite.EF6"/>
</connectionStrings>
<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.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<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>
App.config đó có noy trông đúng. Xin vui lòng xóa và chỉ cài đặt gói sqlite.ef6 - nhưng expdct nó được run rẩy, đề nghị Yiu báo cáo bất kỳ vấn đề tại system.data.sqlite.org – ErikEJ
@ErikEJ tôi gỡ bỏ cài đặt các gói và cài đặt lại chỉ gói EF6. Ít phụ thuộc hơn đã được cài đặt ngay bây giờ, nhưng app.config resuling là giống hệt nhau và lỗi vẫn còn. Gói này có hơn 4.000 lượt tải xuống, do đó, phải có trình hướng dẫn có sẵn để hoạt động. – Dabblernl
Khi nào bạn gặp lỗi? – ErikEJ