vs2017错误ado.net模型向导ErikEJ SqlCeToolbox

时间:2018-12-21 10:55:06

标签: sqlite model ado.net entity-framework-6 wizard

vs2017 v15.5.6 ado.net模型向导不起作用

我的app.config

    <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>  
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
  </startup>
  <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" />
      <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <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>
</configuration>

错误:

  

连接到数据库时发生错误。该数据库可能不可用。发生类型'system.invalidcastexception'的异常。错误消息是:无法将system.data.sqlite.sqliteconnection强制转换为system.data.sqlite.sqliteconnection。类型A源自“ system.data.sqlite,版本= 1.0.108.0,区域性=中性

1 个答案:

答案 0 :(得分:0)

所以,我卸载

System.Data.SQLite 1.0.109
System.Data.SQLite.Core 1.0.109
System.Data.SQLite.Linq 1.0.109
System.Data.SQLite.EF6 1.0.109

and install
System.Data.SQLite.EF6 1.0.108
System.Data.SQLite.Linq 1.0.108
System.Data.SQLite.Core 1.0.108
System.Data.SQLite 1.0.108

问题解决了 谢谢大家