无法迁移asp.net mvc数据库

时间:2016-04-15 15:36:09

标签: c# mysql asp.net-mvc database visual-studio

我尝试在ASP.NET MVC上迁移我的数据库。我按照说明使用此代码启用迁移:

启用 - 迁移-EnableAutomaticMigrations

当我写更新数据库

它给了我这个: 指定' -Verbose'用于查看应用于目标数据库的SQL语句的标志

当我尝试访问页面上的注册表时,它会给我: **服务器错误/应用程序**

2 个答案:

答案 0 :(得分:0)

按照以下步骤操作

after create your entities in Package Manager Console write "Enable-migrations"
step 2 change  AutomaticMigrationsEnabled = false; to true
step 3 write "Update-database"
try and tell me what happen 

答案 1 :(得分:0)

我有一个类似的问题,我无法启用迁移,那是因为我选择了一个空的MVC模板,并且在创建项目时未激活身份验证(这仅适用于Visual Studio 2017和2019)仅仅是因为在VS 2015中它们是自动启用的)