简体   繁体   中英

Cannot migrate asp.net mvc database

I tried to migrate my database on ASP.NET MVC. I followed the instructions where you have to enable migration using this code:

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

When I am trying to access the register on the page, it gives me: ** 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 它们会自动启用)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM