Open Closed

Unable To Create Attribute of IdentityUser.cs in Master Entity Using ABP Suite #10822


User avatar
0
zhongquan.ooi created

Hi, Getting error when creating new Master Entity with one of the attributes in Navigation Properties section is of IdentityUser.cs type. Below is the screenshot for the error:

Below is the screenshot for Navigation Properties section:

Below is the screenshots for the Entity info section:

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
    • ABP Suite can’t reliably generate a navigation property whose entity type is IdentityUser (i.e., Volo.Abp.Identity.IdentityUser). That usually ends up with a compile/migration failure during “DB migration step” (Suite runs dotnet build and then applies EF Core migrations).
    • The supported approach is to reference the user by Guid (e.g., CreatorUserId, MaintenanceIndividualId, etc.) in your aggregate/entity, and (optionally) let Suite use a DTO type for the UI lookup/display, instead of using IdentityUser as a domain navigation target.

    What to do (works with Suite)

    1. Do not choose IdentityUser.cs as the navigation target in ABP Suite.
    2. In your entity, keep only the FK:
    public Guid? MaintenanceIndividualId { get; set; }
    
    1. (If you want dropdown/modal selection + display in the generated UI)
      • Use a user DTO type (or the app’s AppUser/AppUserDto if your solution has it) as described in the article below.
      • In Suite “Navigation Properties”, select the user entity from your domain (commonly AppUser) and its corresponding DTO (commonly AppUserDto / or an IdentityUserDto-derived DTO if needed), and choose Name as display property.

    This is exactly the recommended workaround: Suite needs a DTO for the target to generate lookup/display correctly; directly targeting IdentityUser often breaks generation/build.

    Sources

    • https://abp.io/community/articles/furp75ex (Adding the User entity as a navigation property in ABP Suite)
    • https://docs.abp.io/en/commercial/latest/abp-suite/index (ABP Suite docs)

    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,

    The error popup comes from the dotnet ef migrations add step. It compiles the solution first, but the actual compiler errors are not shown in that popup, so we need the real build output to find the root cause.

    Could you share the following:

    1. Run dotnet build in the solution root folder and share the error output.
    2. Your UI framework and database provider (MVC / Angular / Blazor, EF Core / MongoDB).
    3. The first screenshot shows 3 navigation properties on this entity. Do all of them target IdentityUser.cs, or do some of them target your own entities?

    You can also send the full build log to liming.ma@volosoft.com if it's too large for this thread.

    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.