Open Closed

Entity Generation Failed At DB Migration Step #10832


User avatar
0
zhongquan.ooi created

Hi, When i was creating 1 master entity with just 1 property such as Remarks, it failed at the last step saying the db migration error like shown in screenshot, but all the files related to the entity have been generated (just without the migration step and file)

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

2 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This error means ABP Suite/Studio runs a build before creating the EF Core migration, and your solution does not compile after the generated files were added. So the code is generated, but the migration step is skipped because dotnet build failed.

    • Fix it by building your solution and then adding the migration manually:

      1. Build and see the real compiler error
    dotnet build
    

    Fix whatever compile error appears (most commonly: missing using/namespace, duplicate class name, broken partial class, package restore issues, etc.).

    1. Add the migration manually (EF Core) Go to the folder that contains your *.EntityFrameworkCore project (or the project that contains your DbContext), then run:
    dotnet ef migrations add Added_<YourEntityName> --context <YourDbContextName>
      dotnet ef database update --context <YourDbContextName>
    
    1. After the project builds successfully, you can re-run generation; the migration step should succeed as well.
    • If you are using the microservice template, note that Suite may fail when trying to generate UI parts; in that case generate backend only and always handle migrations manually as above.

    Links:

    • https://abp.io/docs/latest/suite
    • https://abp.io/docs/latest/framework/data/entity-framework-core/migrations

    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,

    This popup comes from the final dotnet ef migrations add step. Suite generates the entity files first, then runs that command. dotnet ef builds the startup project and its referenced projects before adding the migration, and that build is failing — so the files are there but no migration is created. It's the same failure stage as in your question #10822, but the popup doesn't include the underlying build errors.

    Could you run the following from the solution root and share the logs.txt file? It will contain the build errors the popup omits.

    dotnet build > logs.txt
    

    Please hold off on generating more entities until we've checked that output, since Suite writes the files before it reaches the migration step.

    If the file is too large for this thread, you can send it to 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 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.