未找到具備固定名稱「System.Data.SQLite」的 ADO.NET 提供程序的實體框架提供程序

用戶代碼未處理 System.InvalidOperationException
  HResult=-2146233079
  Message=未找到具備固定名稱「System.Data.SQLite」的 ADO.NET 提供程序的實體框架提供程序。請確保在應用程序配置文件的「entityFramework」節中註冊了該提供程序。有關詳細信息,請參閱 http://go.microsoft.com/fwlink/?LinkId=260882。
  Source=EntityFramework
  StackTrace: 
      web

 

webconfig框架

<connectionStrings>
    <add name="UserConnection" connectionString="data source=|DataDirectory|\UserRole.s3db" providerName="System.Data.SQLite"/>
    <!--<add name="UserModel" connectionString="data source=(LocalDb)\v11.0;initial catalog=UserRole.Models.UserModel;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />-->
  </connectionStrings>
  <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,
           Version=1.0.93.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>-->
      <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.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="v11.0" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>

<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />ide

改成spa

<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />3d

相關文章
相關標籤/搜索