Open Closed

Multiple database migrations failed. #9873


User avatar
0
1198462239 created

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • The error message in your screenshot indicates two main issues when running dotnet ef migrations add for multiple DbContexts:
    1. Entity Framework Tools Version Mismatch
      • The EF Core tools version (8.0.8) is older than the runtime version (9.0.8).
      • Solution: Update your EF Core tools to match the runtime version. Run:
    dotnet tool update --global dotnet-ef
    
     Or, if you use a local tool manifest:
    
    dotnet tool update dotnet-ef
    
    1. Unable to Create a DbContext Instance
      • The error says it cannot create a DbContext of type WaveSecureVeltris.EntityFrameworkCore.ConfigDbContext.
      • This is usually caused by a missing or misconfigured IDesignTimeDbContextFactory<ConfigDbContext>.
      • Solution: Ensure you have a correctly implemented ConfigDbContextFactory in your EntityFrameworkCore project. The factory should look like:
    public class ConfigDbContextFactory : IDesignTimeDbContextFactory<ConfigDbContext>
         {
             public ConfigDbContext CreateDbContext(string[] args)
             {
                 var optionsBuilder = new DbContextOptionsBuilder<ConfigDbContext>();
                 optionsBuilder.UseSqlServer("Your_Connection_String_Here");
                 return new ConfigDbContext(optionsBuilder.Options);
             }
         }
    
    • Make sure the connection string is valid and the factory is in the same assembly as your DbContext.

    Summary of Steps:

    1. Update EF Core tools to match your runtime.
    2. Double-check your IDesignTimeDbContextFactory implementation and connection string.

    References:


    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the DBContext factory code

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    1198462239 created

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share a project to reproduce?

    liming.ma@volosoft.com

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.