c# – 如何让Entity Framework CTP5与SQLite一起使用?

我在使用带有EF CTP5的SQLite数据库时非常困难.我只是试图用SQLite执行这个MSDN example.但是在线
var food = db.Categories.Find("FOOD");
我收到运行时异常:
System.Data.SQLite.SQLiteException (0x80004005): SQLite errorno such table: Categories
注意:必须修改app.config文件,如下所示:
App.config中
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
<runtime>
<generatePublisherEvidence enabled="false" />
</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>
<connectionStrings>
<add name="ProductContext" connectionString="Data Source=D:\CodeFirst.db;Version=3;New=True;" providerName="System.Data.SQLite" />
</connectionStrings>
</configuration>
最佳答案:
在我看来,当前的SQLite.net首先不支持Entity Framework CTP5代码.将不得不等待这种情况发生.