简体   繁体   English

无法迁移asp.net mvc 数据库

[英]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.

相关问题 无法迁移 ASP.NET 核心 API 中的第二个数据库 - Cannot migrate second database in ASP.NET Core API asp.net mvc Web应用程序错误“无法将数据库作为...附加” - asp.net mvc web application error “cannot attach database … as … ” 迁移Asp.Net配置文件提供程序以在MVC中工作(扩展无法工作) - Migrate Asp.Net Profile Provider to Work in MVC (extending not working) 将RouteConfig文件从ASP.Net MVC 4迁移到5 - Migrate a RouteConfig file from ASP.Net MVC 4 to 5 如何将 asp.net webform 和 mvc 4 应用程序迁移到 AngularJS 站点 - How to migrate an asp.net webform and mvc 4 application to AngularJS site 将用户ASP.NET网页表迁移到MVC 6 - Migrate Users ASP.NET Web Pages tables to MVC 6 如何在 MVC 应用程序中将 ASP.NET 成员资格迁移到 SAML? - How to migrate ASP.NET membership to SAML in an MVC application? 如何将 ASP.NET MVC 视图迁移到 Angular UI - How to migrate the ASP.NET MVC View to Angular UI 我如何将一个简短的 ASP.NET WebForms 应用程序迁移到 ASP.NET MVC 应用程序? - How i can migrate a short ASP.NET WebForms Application to ASP.NET MVC Application? ASP.NET MVC-找不到资源 - ASP.NET MVC - The resource cannot be found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM