繁体   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