简体   繁体   English

在Visual Studio 2012中打开的asp.net mvc3应用程序,无法找到程序集“EntityFramework”

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

I opened and edited an ASP.NET MVC 3 application developed in Visual Studio 2010, in Visual Studio 2012. It was working fine in Debug mode but when I tried to publish it (release mode), it failed and threw following warnings and errors. 我在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 is present in bin folder and EntityFramework 5.0 is installed. EntityFramework.dll存在于bin文件夹中,并且已安装EntityFramework 5.0。 Can this be resolved ? 这可以解决吗?

What am I doing wrong while migrating this project? 迁移这个项目时我做错了什么? Microsoft says no modifications are needed when going from VS 2010 to VS 2012 http://msdn.microsoft.com/en-us/library/vstudio/jj161050.aspx#ASP . 微软表示从VS 2010到VS 2012时不需要进行任何修改http://msdn.microsoft.com/en-us/library/vstudio/jj161050.aspx#ASP

If there is a file called packages.config in the project, open it and remove the reference to EntityFramework (something like <package id="EntityFramework" ... /> ). 如果项目中有一个名为packages.config的文件,请打开它并删除对EntityFramework的引用(类似<package id="EntityFramework" ... /> )。 Also remove the reference to the assembly from the project (select the assembly under 'References' and delete it) and remove the assembly from the bin folder. 同时从项目中删除对程序集的引用(在“引用”下选择程序集并将其删除),然后从bin文件夹中删除程序集。

Now you can reinstall the package using the package manager (right click the project and select "Manage NuGet Packages"). 现在,您可以使用包管理器重新安装包(右键单击项目并选择“Manage NuGet Packages”)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无论如何在ASP.NET MVC3应用程序的Visual Studio 2012中使用PageInspector? - Anyway to use PageInspector in Visual Studio 2012 in ASP.NET MVC3 app? 在ASP.NET MVC应用程序中使用EntityFramework的持久性 - Persistence with EntityFramework in ASP.NET MVC application 使用Visual Studio 2012在ASP.NET上运行WPF应用程序 - Run WPF application on ASP.NET using Visual Studio 2012 Visual Studio 2012中“ /”应用程序中的ASP.NET服务器错误 - ASP.NET Server Error in '/' Application in Visual Studio 2012 无法找到程序集“EntityFramework” - Could not locate assembly “EntityFramework” 无法加载文件或程序集&#39;Microsoft.VisualStudio.TeamSystem.Licensing,用visual studio 2015打开ASP.Net MVC项目后 - Could not load file or assembly 'Microsoft.VisualStudio.TeamSystem.Licensing, After opening ASP.Net MVC project with visual studio 2015 使用 Visual Studio 代码创建 Asp.net MVC 应用程序(非核心) - Create Asp.net MVC Application (not core) with visual studio code ASP.Net MVC3通过Visual Studio修改日期和小数的文化? - ASP.Net MVC3 Modify culture for date and decimal through or not Visual Studio? 如何在Visual Studio 2012上使用ASP.NET(包含MVC)C#配置或设置Log4Net - How to configure or setup Log4Net with ASP.NET ( included MVC) C# on Visual Studio 2012 ~ ~ <a>点击时</a>改变颜色<a>(asp.net mvc 4 visual studio 2012)?</a> - Change color <a> when click (asp.net mvc 4 visual studio 2012)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM