From 6c64975c12e6c47851c585ad1a22f39b2e5f8587 Mon Sep 17 00:00:00 2001 From: Ma Liming Date: Tue, 20 Jan 2026 16:33:01 +0800 Subject: [PATCH] Update framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Abp/Cli/ProjectModification/EfCoreMigrationManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs index d9c492d124..88e9356d89 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs @@ -44,8 +44,13 @@ public class EfCoreMigrationManager : ITransientDependency string dbContext, string outputDirectory) { - CmdHelper.RunCmd($"dotnet build", workingDirectory: dbMigrationsProjectFolder); + CmdHelper.RunCmd($"dotnet build", workingDirectory: dbMigrationsProjectFolder, exitCode: out var buildExitCode); + if (buildExitCode != 0) + { + Logger.LogWarning("Dotnet build failed for project folder {ProjectFolder}. Skipping EF Core migration command.", dbMigrationsProjectFolder); + return; + } var dbContextOption = string.IsNullOrWhiteSpace(dbContext) ? string.Empty : $"--context {dbContext}";