Open Closed

Errors generating entities through ABP Suite #10484


User avatar
0
Prinay created

Hi,

I am experiencing the following issue using ABP Suite: "Circular base type dependency involving 'PaymentsAppService' and 'PaymentsAppServiceBase' There have been no changes to solution or source code and everything is entirely generated.

I am using ABP Studio Business Edition 2.2.1 and ABP Suite 10.1.0.

I have generated two basic entities (No navigation properties): Here is the customer entity which generated successfully: { "Id": "90415f79-7b18-49fb-86b6-a28b65f7601f", "Name": "Customer", "OriginalName": "Customer", "NamePlural": "Customers", "DatabaseTableName": "Customers", "Namespace": "Customers", "Type": 1, "MasterEntityName": null, "MasterEntity": null, "BaseClass": "Entity", "PageTitle": "Customers", "MenuIcon": "file-alt", "PrimaryKeyType": "Guid", "PreserveCustomCode": true, "IsMultiTenant": false, "CheckConcurrency": true, "BulkDeleteEnabled": false, "ShouldCreateUserInterface": false, "ShouldCreateBackend": true, "ShouldExportExcel": false, "ShouldAddMigration": true, "ShouldUpdateDatabase": true, "CreateTests": true, "Properties": [ { "Id": "2732feac-1a31-4d0b-b136-aea654d71b18", "Name": "Name", "Type": "string", "EnumType": "", "EnumNamespace": "", "EnumAngularImport": "shared/enums", "EnumFilePath": null, "DefaultValue": null, "IsNullable": false, "IsRequired": true, "IsFilterable": true, "AllowEmptyStrings": false, "IsTextArea": false, "MinLength": 1, "MaxLength": 100, "SortOrder": 0, "SortType": 0, "Regex": "", "EmailValidation": false, "ShowOnList": true, "ShowOnCreateModal": true, "ShowOnEditModal": true, "ReadonlyOnEditModal": false, "EnumValues": null, "IsSelected": true, "MaxFileSize": null, "OrdinalIndex": 0 }, { "Id": "a4413db3-202c-42ec-aefb-8640c11dece6", "Name": "Surname", "Type": "string", "EnumType": "", "EnumNamespace": "", "EnumAngularImport": "shared/enums", "EnumFilePath": null, "DefaultValue": null, "IsNullable": false, "IsRequired": true, "IsFilterable": true, "AllowEmptyStrings": false, "IsTextArea": false, "MinLength": 1, "MaxLength": 100, "SortOrder": 0, "SortType": 0, "Regex": "", "EmailValidation": false, "ShowOnList": true, "ShowOnCreateModal": true, "ShowOnEditModal": true, "ReadonlyOnEditModal": false, "EnumValues": null, "IsSelected": true, "MaxFileSize": null, "OrdinalIndex": 0 }, { "Id": "7c1aab08-3397-4164-a91a-702e8516e382", "Name": "Email", "Type": "string", "EnumType": "", "EnumNamespace": "", "EnumAngularImport": "shared/enums", "EnumFilePath": null, "DefaultValue": null, "IsNullable": false, "IsRequired": true, "IsFilterable": true, "AllowEmptyStrings": false, "IsTextArea": false, "MinLength": 1, "MaxLength": 100, "SortOrder": 0, "SortType": 0, "Regex": "", "EmailValidation": true, "ShowOnList": true, "ShowOnCreateModal": true, "ShowOnEditModal": true, "ReadonlyOnEditModal": false, "EnumValues": null, "IsSelected": true, "MaxFileSize": null, "OrdinalIndex": 0 } ], "NavigationProperties": [], "NavigationConnections": [], "ChildEntities": [], "PhysicalFileName": "Customer.json" }

Here is the payment entity which is failing: { "Id": "6f1322d7-9856-4f66-aaaf-c00ff0e4f556", "Name": "Payment", "OriginalName": "Payment", "NamePlural": "Payments", "DatabaseTableName": "Payments", "Namespace": "Payments", "Type": 1, "MasterEntityName": null, "MasterEntity": null, "BaseClass": "Entity", "PageTitle": "Payments", "MenuIcon": "file-alt", "PrimaryKeyType": "Guid", "PreserveCustomCode": true, "IsMultiTenant": false, "CheckConcurrency": true, "BulkDeleteEnabled": false, "ShouldCreateUserInterface": false, "ShouldCreateBackend": true, "ShouldExportExcel": false, "ShouldAddMigration": true, "ShouldUpdateDatabase": true, "CreateTests": true, "Properties": [ { "Id": "58594521-dfe5-4012-bd73-88d54d2db9fa", "Name": "Amount", "Type": "decimal", "EnumType": "", "EnumNamespace": "", "EnumAngularImport": "shared/enums", "EnumFilePath": null, "DefaultValue": null, "IsNullable": false, "IsRequired": false, "IsFilterable": true, "AllowEmptyStrings": false, "IsTextArea": false, "MinLength": null, "MaxLength": null, "SortOrder": 0, "SortType": 0, "Regex": "", "EmailValidation": false, "ShowOnList": true, "ShowOnCreateModal": true, "ShowOnEditModal": true, "ReadonlyOnEditModal": false, "EnumValues": null, "IsSelected": true, "MaxFileSize": null, "OrdinalIndex": 0 }, { "Id": "3501cbc6-9b1d-4b2b-a0e1-5973fb03617a", "Name": "InitiatedDatetime", "Type": "DateTime", "EnumType": "", "EnumNamespace": "", "EnumAngularImport": "shared/enums", "EnumFilePath": null, "DefaultValue": null, "IsNullable": false, "IsRequired": false, "IsFilterable": true, "AllowEmptyStrings": false, "IsTextArea": false, "MinLength": null, "MaxLength": null, "SortOrder": 0, "SortType": 0, "Regex": "", "EmailValidation": false, "ShowOnList": true, "ShowOnCreateModal": true, "ShowOnEditModal": true, "ReadonlyOnEditModal": false, "EnumValues": null, "IsSelected": true, "MaxFileSize": null, "OrdinalIndex": 0 }, { "Id": "27fb6087-71e4-47d9-ada6-3fcf02e84d0b", "Name": "AccountNumber", "Type": "string", "EnumType": "", "EnumNamespace": "", "EnumAngularImport": "shared/enums", "EnumFilePath": null, "DefaultValue": null, "IsNullable": false, "IsRequired": true, "IsFilterable": true, "AllowEmptyStrings": false, "IsTextArea": false, "MinLength": 5, "MaxLength": 20, "SortOrder": 0, "SortType": 0, "Regex": "", "EmailValidation": false, "ShowOnList": true, "ShowOnCreateModal": true, "ShowOnEditModal": true, "ReadonlyOnEditModal": false, "EnumValues": null, "IsSelected": true, "MaxFileSize": null, "OrdinalIndex": 0 } ], "NavigationProperties": [], "NavigationConnections": [], "ChildEntities": [], "PhysicalFileName": "Payment.json" }

Here are my errors:

I have not run into this in the past and this is a very basic set up.

My solution configuration: - **Template**: app - **Created ABP Studio Version**: 2.2.1 - **Current ABP Studio Version**: 2.2.1 - **Tiered**: No - **Multi-Tenancy**: No - **UI Framework**: mvc - **Theme**: basic - **Theme Style**: system - **Theme Menu Placement**: side - **Database Provider**: ef - **Database Management System**: sqlserver - **Separate Tenant Schema**: No - **Mobile Framework**: none - **Public Website**: No - **Social Login**: No - **Include Tests**: Yes - **Kubernetes Configuration**: No - **Distributed Event Bus**: none - **Use Local References**: No - **Optional Modules**: * GDPR * LanguageManagement * AuditLogging * OpenIddictAdmin - **Selected Languages**: English, Arabic, Chinese (Simplified), Chinese (Traditional), Czech, English (United Kingdom), Finnish, French, German (Germany), Hindi , Hungarian, Icelandic, Italian, Portuguese (Brazil), Romanian (Romania), Russian, Slovak, Spanish, Swedish, Turkish - **Default Language**: English - **Create Command**: abp new Payments -t app --ui-framework mvc --database-provider ef --database-management-system sqlserver --theme basic --skip-migration --skip-migrator --without-cms-kit --dont-run-install-libs --dont-run-bundling --no-multi-tenancy --no-social-logins -no-file-management -no-text-template-management


8 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This compilation error happens when ABP Suite generates the customizable code pattern incorrectly (or it was partially generated), so the two files end up inheriting from each other:

      • PaymentsAppService.cs inherits from PaymentsAppServiceBase
      • and PaymentsAppServiceBase.cs inherits from PaymentsAppService

      That creates CS0146 Circular base type dependency, and because the base class can’t be compiled, you also see follow-up errors like “ObjectMapper does not exist in the current context” and interface members not implemented.

    • Fix (safe + minimal):

      1. Open PaymentsAppService.cs and PaymentsAppServiceBase.cs and make the inheritance one-way only:

        • PaymentsAppServiceBase must inherit from ABP’s ApplicationService (or CrudAppService<...> depending on what Suite generated).
        • PaymentsAppService must inherit from PaymentsAppServiceBase.
        • Ensure the base class does NOT inherit from the derived class.

        Example of the intended structure:

    // PaymentsAppServiceBase.cs
         public abstract class PaymentsAppServiceBase : ApplicationService, IPaymentsAppService
         {
             // generated implementations and protected helpers
         }
    
         // PaymentsAppService.cs
         public partial class PaymentsAppService : PaymentsAppServiceBase
         {
             // your customizations (can be empty)
         }
    
    1. After fixing inheritance, ensure PaymentsAppServiceBase ultimately derives from ApplicationService (directly or indirectly). That restores ObjectMapper (it’s provided by ApplicationService), and the interface implementation errors will disappear once the base class compiles.

    2. Clean + rebuild the solution.

    • Practical workaround if you want to avoid manual edits next time:
      • Regenerate the entity without “Preserve custom code / Customizable code” (so Suite generates a single app service file), or delete the generated PaymentsAppService*.cs files and regenerate again (so you don’t keep a broken partial generation state).

    No verified source available for this specific ABP Suite code-generation bug (the circular inheritance is a generated-code issue rather than a documented framework behavior).


    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.

  • User Avatar
    0
    Prinay created

    Fixing it manually defeats the purpose of the generation capability.

    I have unchecked "Customizable Code" - which is also disappointing - but still run into the error:

  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This is not caused by the “Customizable code” option at this point. The screenshot shows public class PaymentsAppService : PaymentsAppService, IPaymentsAppService — i.e., the class is inheriting from itself, which produces CS0146 (“Circular base type dependency involving 'PaymentsAppService' and 'PaymentsAppService'”).
    • When the AppService class fails to compile, you also get secondary errors like ObjectMapper does not exist (because the generated class no longer successfully derives from ApplicationService).

    Solution

    1. Delete the previously generated Payment service artifacts (so Suite doesn’t try to merge into a broken state):
      • In Payments.Application, delete:
        • PaymentsAppService.cs
        • Any related generated partial/base files for payments (e.g., PaymentsAppServiceBase.cs, PaymentsAppService.Extended.cs, etc. if they exist)
      • Also delete the generated payments DTO folder/files and application contract interface if they were partially generated (only those related to Payment).
    2. Clean the solution output folders:
      • Delete all bin/obj folders (or run dotnet clean).
    3. Regenerate the entity again from ABP Suite (with Customizable Code on or off—either is fine once you’ve removed the corrupted generated files).
    4. If it still generates : PaymentsAppService (self-inheritance), this indicates a code-generation bug in ABP Suite 10.1.0 for your project state. The only non-manual workaround is:
      • Upgrade ABP Suite / ABP Studio to a newer patch version (so the generator is fixed), then regenerate.

    Why generation fails at “DB migration step”

    ABP Suite runs a build before migrations. Since the generated code has self-inheritance, build fails, so Suite stops and shows the “Make sure the project is compiled and working” dialog.

    Verified external reference (related known .NET DI circular issues; not the same as your compile-time issue)

    • https://www.nuget.org/packages/Microsoft.Extensions.Caching.StackExchangeRedis/9.0.5

    No verified source available for this specific ABP Suite self-inheriting AppService generation issue.


    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.

  • User Avatar
    0
    Prinay created

    I have deleted all generated code and reran generation from ABP suite but still experience the error. I have also tried switching to the preview version 10.2.0-rc.1 for the abp project and for ABP studio but the error still persist.

  • User Avatar
    0
    Prinay created

    Additional context. If I create related entities with Create user interfaces checked I run into even more issues. Again, I have made 0 customisations and this is just pure generation at this point.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [Prinay] said: Additional context.

    If I create related entities with Create user interfaces checked I run into even more issues.

    Again, I have made 0 customisations and this is just pure generation at this point.

    Hi Prinay,

    It seems the error is caused by the project name and entity name being the same. To help us reproduce the issue, could you share your solution via email to support@abp.io with your ticket number? If that's not possible, please let me know and I'll try to reproduce it using the configurations you've provided above.

    Also, could you confirm whether you have a DTO class called DownloadTokenResultDto and that its namespace is different from Payments.Shared?

    Best regards.

  • User Avatar
    0
    Prinay created

    Hi EngincanV,

    Your recommendation worked perfectly. I have renamed the entity to not match the project name and it generated perfectly. I will note this going forward. The DownloadTokenResultDto error is also gone. I suspect it was the conflicting namespace too as you mentioned. Thanks for the assistance.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [Prinay] said: Hi EngincanV,

    Your recommendation worked perfectly. I have renamed the entity to not match the project name and it generated perfectly.

    I will note this going forward. The DownloadTokenResultDto error is also gone. I suspect it was the conflicting namespace too as you mentioned.

    Thanks for the assistance.

    Hi @Prinay, I'm happy to help.

    Best regards.

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.3.0-preview. Updated on March 02, 2026, 08:48
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.