【发布时间】:2017-02-21 04:43:09
【问题描述】:
我使用 MVC 应用程序制作简单的 EntityFramework。我的解决方案有 3 个项目
- 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
【问题讨论】:
标签: entity-framework asp.net-mvc-4 dbcontext csproj