【问题标题】:I deleted Migrations file and folder .I try again dotnet ef migration add initial but I see Built failed我删除了 Migrations 文件和文件夹。我再次尝试 dotnet ef migration add initial 但我看到 Built failed
【发布时间】:2019-12-25 13:18:13
【问题描述】:

我正在开发一个 ASP.NET Core MVC 应用程序。我删除了迁移文件和文件夹。我再次尝试使用 .NET EF Core 迁移并添加初始值,但我看到构建失败。我该怎么做?

【问题讨论】:

标签: entity-framework-core asp.net-core-mvc migration


【解决方案1】:

您的问题没有解释很多事情,例如您是否在迁移文件夹中创建了任何其他类或命名空间并意外删除了它。

构建失败错误是由一些丢失的文件、参考或一些语法错误引起的。 检查 Visual Studio 中的错误列表选项卡。

【讨论】:

  • 首先谢谢你。我曾经在 CLI 中编写命令 ">dotnet ef migrations add initial" ,我只能看到 "Build Failed" 。然后我使用 Package Maneger Console "PM> add-migration initial" 并进行更多描述。当我修复错误时,我成功了
【解决方案2】:

我曾经在 CLI 中编写命令 ">dotnet ef migrations add initial" ,但我只能看到 "Build Failed" 。然后我使用 Package Maneger Console "PM> add-migration initial" 并进行更多描述。当我修复错误时,我成功了 [链接]https://www.entityframeworktutorial.net/efcore/entity-framework-core-console-application.aspx

【讨论】:

    猜你喜欢
    • 2011-12-29
    • 2021-07-04
    • 1970-01-01
    • 1970-01-01
    • 2022-07-19
    • 2011-07-13
    • 2012-03-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多