我有我的POCO模型比我的asp.net mvc 3網站是單獨的DLL。LinqPad - EntityFramework 4.3.1 - MissingMethodException - Sql Compact
我在LinqPad Beta:v4.41.01中爲Poco創建了新的連接,爲自定義dll提供了路徑,選擇了DbContext,通過無參數構造函數選擇。
這不起作用,因爲我使用的是SqlServer Compact。
然後創建dummy.config文件,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
<connectionStrings>
<add name="ModelContext"
connectionString="data source=database.sdf"
providerName="system.data.sqlserverce.4.0" />
</connectionStrings>
</configuration>
有了這個,在連接測試顯示成功。甚至,左邊的樹也被填充。但是,當我運行任何查詢時,它會拋出異常,如下所示: 未找到方法:'System.Data.Entity.DbSet`1 InventoryModelContext.get_xxx()'。
編輯另外,請注意,這似乎是編譯錯誤!
任何解決方案或解決方法?我錯過了什麼嗎?
在此先感謝。