ASP.NET-Identity-User-Management icon indicating copy to clipboard operation
ASP.NET-Identity-User-Management copied to clipboard

关于数据库初始化

Open BsaGyy opened this issue 8 years ago • 3 comments

你好,有个问题还是想请教下您。 为什么您的程序中数据库初始化策略(DropCreateDatabaseIfModelChanges)不执行呀?我把迁移文件夹删除之后就会执行了,而且之后再Enable-Migrations生成迁移文件夹之后数据库初始化策略依然可以执行,不知道您是否有做了什么设置导致它不执行?

BsaGyy avatar Jul 04 '17 04:07 BsaGyy

DropCreateDatabaseIfModelChanges :模型更改时会创建数据库。不执行的情况就是模型没更改吧,字面理解。

MEyes avatar Jul 04 '17 16:07 MEyes

感谢您的解答,实际上我已经对模型做了修改,策略也被修改成为DropCreateDatabaseAlways过,都没有执行。好吧 确实是个很奇怪的事,再次感谢

BsaGyy avatar Jul 05 '17 00:07 BsaGyy

我下载您的代码后运行报如下异常,可否请教下是什么问题 报错异常英文 The following errors occurred while attempting to load the app.

  • No assembly found containing an OwinStartupAttribute.
  • No assembly found containing a Startup or [AssemblyName].Startup class. To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config. To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.

报错中文 尝试加载应用程序时发生以下错误。

  • 找不到包含OwinStartupAttribute的程序集。
  • 找不到包含Startup或[AssemblyName] .Startup类的程序集。 要禁用OWIN启动发现,请在web.config中添加值为“false”的appSetting owin:AutomaticAppStartup。 要指定OWIN启动程序集,类或方法,请在web.config中使用完全限定的启动类或配置方法名称添加

realyrare avatar Aug 01 '18 09:08 realyrare