您的位置:首页 > 产品设计 > UI/UE

Additional information: The model backing the 'StuInfoDBContext' context has changed since the datab

2015-03-26 00:07 435 查看
异常:

Additional information: The model backing the 'StuInfoDBContext' context has changed since the database was created. Consider using Code First Migrations to update the database



解决办法:

Global.asax文件中加:Database.SetInitializer<StuInfoDBContext>(null);

using System.Data.Entity;
using Iweb.Areas.SiteInfo.Models;

namespace Iweb
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801 public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{

Database.SetInitializer<StuInfoDBContext>(null);
AreaRegistration.RegisterAllAreas();

WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
}
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐