首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >ADO.NET实体框架和ASP.MVC的组合是不是错了?

ADO.NET实体框架和ASP.MVC的组合是不是错了?
EN

Stack Overflow用户
提问于 2009-10-01 02:32:36
回答 3查看 9.1K关注 0票数 15

我有三个项目的一个解决方案。

  1. DomainModel (带有ADO.NET Entity Framework)
  2. DomainModelTest (业务逻辑单元测试)的C#库)
  3. WebApp(使用DomainModel)

由于某些原因,如果我传递DomainModel中的任何对象,我甚至不能带来视图,甚至不是简单的。我得到以下错误:

有什么想法吗?

'System.Data.Objects.DataClasses.EntityObject‘编译器错误消息:

:类型CS0012是在未引用的程序集中定义的。必须添加对程序集'System.Data.Entity,Version=3.5.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089‘的引用。

源错误:

146行:147行:

公共类148行: System.Web.SessionState.IRequiresSessionState,views_home_index_aspx : System.Web.Mvc.ViewPage,System.Web.IHttpHandler {第149行:

第150行:私有静态布尔@__initialized;

我认为这可能会有所帮助,实际的错误出现在Default.aspx文件的下面一行中:

代码语言:javascript
复制
public partial class _Default : Page
{
    public void Page_Load(object sender, System.EventArgs e)
    {
        // Change the current path so that the Routing handler can correctly interpret
        // the request, then restore the original path so that the OutputCache module
        // can correctly process the response (if caching is enabled).

        string originalPath = Request.Path;
        HttpContext.Current.RewritePath(Request.ApplicationPath, false);
        IHttpHandler httpHandler = new MvcHttpHandler();
        httpHandler.ProcessRequest(HttpContext.Current); //**HERE**
        HttpContext.Current.RewritePath(originalPath, false);
    }
}
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1501616

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档