2010-06-07 68 views
1

我的ASP.Net MVC 2項目引用了一個Domain項目,其中定義了POCO業務對象,並且實現了一個EF 4 POCO持久性實現的Data項目。ASP.Net MVC 2/EF 4參考文獻

事情運行良好,直到我與我的版本控制提供者(回滾到以前的版本留給我一起合併衝突)有點模糊。現在,在啓動的MVC 2項目中,我得到一個運行時錯誤:

The type 'System.Data.Objects.DataClasses.IEntityWithKey' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

然而,項目引用System.Data.Entity的(同一版本)。

如果我從MVC 2項目中刪除了對System.Data.Entity的引用,則會收到與編譯時錯誤相同的消息。

我敢肯定,當我遇到版本控制問題時,有些事情搞砸了,但真的不知道在哪裏尋找這個。

回答

2

問題來自ASP.NET編譯器,而不是VS編譯器。

您需要在web.Config添加System.Data.Entityassembliessystem.webcompilation