簡體   English   中英

在Visual Studio 2012中打開的asp.net mvc3應用程序,無法找到程序集“EntityFramework”

[英]asp.net mvc3 application opened in Visual Studio 2012, Could not locate the assembly “EntityFramework”

我在Visual Studio 2012中打開並編輯了在Visual Studio 2010中開發的ASP.NET MVC 3應用程序。它在調試模式下工作正常但是當我嘗試發布它(發布模式)時,它失敗並拋出以下警告和錯誤。

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

error CS0234: The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?)

error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)

error CS0246: The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?)

error CS0246: The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)

EntityFramework.dll存在於bin文件夾中,並且已安裝EntityFramework 5.0。 這可以解決嗎?

遷移這個項目時我做錯了什么? 微軟表示從VS 2010到VS 2012時不需要進行任何修改http://msdn.microsoft.com/en-us/library/vstudio/jj161050.aspx#ASP

如果項目中有一個名為packages.config的文件,請打開它並刪除對EntityFramework的引用(類似<package id="EntityFramework" ... /> )。 同時從項目中刪除對程序集的引用(在“引用”下選擇程序集並將其刪除),然后從bin文件夾中刪除程序集。

現在,您可以使用包管理器重新安裝包(右鍵單擊項目並選擇“Manage NuGet Packages”)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM