无法找到类型或名称空间DbContext(EF安装)

问题描述:

我使用MVC应用程序制作简单的EntityFramework。我的解决方案有3个项目无法找到类型或名称空间DbContext(EF安装)

  • GE.BLL
  • GE.Entities
  • GE.Web

一切看起来不错,直到我决定重新命名GE.BLL到GE.Core

所以我删除了整个项目,并再次从头开始添加所有类和引用到GE.Core。现在我的这个项目的EntityFramework安装和System.Data.Entity的还引用但不编译

“的类型或命名空间的DbContext找不到”

我的app.config为

<configuration> 
    <configSections> 
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
</configSections> 
<entityFramework> 
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> 
    <parameters> 
    <parameter value="mssqllocaldb" /> 
    </parameters> 
</defaultConnectionFactory> 
<providers> 
    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> 
</providers> 
</entityFramework> 
</configuration> 

和packages.config是

<packages> 
<package id="EntityFramework" version="6.1.3" targetFramework="net451" /> 
</packages> 

我使用框架4.5.1

所以我卸载了EntityFramework并重新安装了它!

+1

所以..现在工作吗? – thevan

+0

是的! (我只能接受它作为一天后的答案) – Samra