[英]Cannot migrate asp.net mvc database
I tried to migrate my database on ASP.NET MVC.我试图在 ASP.NET MVC 上迁移我的数据库。 I followed the instructions where you have to enable migration using this code:我按照您必须使用以下代码启用迁移的说明进行操作:
Enable-Migrations -EnableAutomaticMigrations Enable-Migrations -EnableAutomaticMigrations
And when I write Update Database当我写更新数据库时
It gives me this: Specify the '-Verbose' flag to view the SQL statements being applied to the target database它给了我这个:指定“-Verbose”标志以查看应用于目标数据库的 SQL 语句
When I am trying to access the register on the page, it gives me: ** Server Error /in Application**当我尝试访问页面上的寄存器时,它给了我:** Server Error /in Application**
follow this steps按照这个步骤
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
好吧,我有一个类似的问题,我无法启用迁移,那是因为我选择了一个空的 MVC 模板,并且我在创建项目时没有激活身份验证(这仅适用于 Visual Studio 2017 和 2019,因为使用VS 2015 它们会自动启用)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.