2014-12-23 23 views
0

錯誤:實體框架拋出一個錯誤在我的.NET命名空間

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

正如你可以看到我的實體框架是在參考抱怨,試圖解決這個問題,但毫無進展。有人遇到過這個問題嗎?基本上,我想這樣做: http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api

+1

您試圖解決什麼問題? 手動添加了dll? 在項目上安裝了nuget軟件包? – dariogriffo

+0

您可能需要嘗試以下方法http://stackoverflow.com/questions/21188454/reference-to-assembly-error –

+4

您需要首先從NuGet安裝EF,然後才能與您的項目一起工作。 – IronMan84

回答

0

轉到您的解決方案,並按照這個步驟(只要您使用與您指定的頁面下載的ZIP):

  • 右擊SLN節點上Enable Nuget package restore,然後重建你的sln。
  • 如果尚未安裝,請嘗試打開Manage Nuget Package並檢查EF是否已安裝。
  • 不建議手動加載dll,但可以嘗試添加它。
相關問題