我正在尝试使用EF6 alpha和SQLite 1.0.66.0
我的.config文件:
<connectionStrings>
<add connectionString="data source=:memory:;" name="TestDbContext" providerName="System.Data.SQLite" />
</connectionStrings>
<entityFramework>
<providers>
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<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.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
</DbProviderFactories>
</system.data>
Run Code Online (Sandbox Code Playgroud)
我跑的时候
using (var dbContext = new TestDbContext())
{
if (dbContext.Database.Exists())
{
dbContext.Database.Delete();
}
dbContext.Database.Create();
}
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
System.InvalidOperationException:System.InvalidOperationException:实体框架提供程序类型'System.Data.SQLite.SQLiteFactory,System.Data.SQLite,Version …