日期:2014-05-17  浏览次数:20514 次

怎么entity framework 4.1 的新类DbContext VS 识别不了啊
装了entity framework 4.1 后 想用Code-First ,继承DbContext类发现DbContext无法通过编译,怎么回事?
C# code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Entity;

namespace MicroBlogs.Model
{
    public class WeiboContext : DbContext //DbContext下面有出错提示,我明明已经引用了System.Data.Entity啊
    {
        public DbSet<Task> tasks { get; set; }//DbSet也是一样通不过编译
        public DbSet<User> users { get; set; }
        public DbSet<Weibo> weibos { get; set; }
    }
}




------解决方案--------------------
没有引用entityframework.dll吧
------解决方案--------------------
是不是缺少EF引用。