标签:typeof lob 数据库 访问 ase protected logs 编译 line
protected void Application_Start()
{
//禁用第一次ef查询对表__MigrationHistory的问题使用了ef的Code first会在第一次ef查询的时候会对__MigrationHistory访问,是为了检查数据库和model是否匹配,以保证ef能正常运行
System.Data.Entity.Database.SetInitializer<DataContext>(null);
//设置当前数据库类型
DbHelper.DbType = (DatabaseType)Enum.Parse(typeof(DatabaseType), ConfigHelper.AppSettings("ComponentDbType"), true);
Application["OnLineCount"] = 0;//在应用程序第一次启动时初始化在线人数为0
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
//添加 ASP.NET Web API 2 的 全部集合,注意这个要放在前面
GlobalConfiguration.Configure(WebApiConfig.Register);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
发布的时候记得要预编译一下:

标签:typeof lob 数据库 访问 ase protected logs 编译 line
原文地址:http://www.cnblogs.com/ghw0501/p/7084766.html