Open Closed

ABP Suite CRUD Generator: startIndex ('-1') must be a non-negative value. (Parameter 'startIndex') #9489


User avatar
0
david1 created

I upgraded to ABP 9.3.0-rc.1 and then suddenly started getting this error when trying to Save and Generate existing models in my ABP solution.

What I've tried:

  1. Uninstall ABP, reinstall
  2. Check ABP version 9.3.0-rc.1
  3. Downgrade to version 9.2.0 (including project/modules)
  4. Re-clone ABP project to new folder and re-build solution (to ensure no compiled files affecting output)

Any suggestions on other things to try to resolve this issue?

Error occurs shortly after Step 1 of 10 shows up:

  • Exception message and full stack trace:
2025-06-18 19:13:49.520 -06:00 [INF] 1/10 - EntityGenerateCommand started...
2025-06-18 19:13:51.422 -06:00 [ERR] ---------- RemoteServiceErrorInfo ----------
{
  "code": null,
  "message": "An internal error occurred during your request!",
  "details": null,
  "data": null,
  "validationErrors": null
}

2025-06-18 19:13:51.426 -06:00 [ERR] startIndex ('-1') must be a non-negative value. (Parameter 'startIndex')
Actual value was -1.
System.ArgumentOutOfRangeException: startIndex ('-1') must be a non-negative value. (Parameter 'startIndex')
Actual value was -1.
   at System.ArgumentOutOfRangeException.ThrowNegative[T](T value, String paramName)
   at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
   at System.String.Substring(Int32 startIndex)
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.CBf4WQwZkH(Boolean  , String  , String  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.gb34LXPXOW(Boolean  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.uuX4U4GI2l()
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.ExecuteAsync(CrudPageCommandOptions options)
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.CommandManager.ExecuteAllAsync(CrudPageCommandOptions options)
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.GenerateAsync(EntityModel entity, Solution solution, EntityModel masterEntity, List`1 navigationConnections)
   at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync(Guid solutionId, EntityModel entity)
   at lambda_method2077(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-06-18 19:13:51.434 -06:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
2025-06-18 19:13:51.436 -06:00 [INF] Executed action Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync (Volo.Abp.Suite) in 3170.6099ms
2025-06-18 19:13:51.436 -06:00 [INF] Executed endpoint 'Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync (Volo.Abp.Suite)'
2025-06-18 19:13:51.436 -06:00 [INF] Request finished HTTP/1.1 POST http://localhost:3000/api/abpSuite/crudPageGenerator/e338179c-6773-451f-9cc5-31ac769167eb/save-and-generate-entity - 500 null application/json; charset=utf-8 3173.7311ms
  • Steps to reproduce the issue:

21 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent

    This error (startIndex ('-1') must be a non-negative value. (Parameter 'startIndex')) is a known issue that can occur in ABP Suite's CRUD Page Generator, especially after upgrades or when working with certain project/module configurations. It is typically caused by Suite failing to parse or locate expected code patterns in your DbContext or related files, often due to:

    • Unexpected or duplicate DbSet definitions
    • Manual changes to the DbContext or entity files
    • Incompatibility between Suite and the current project/module structure
    • Suite not officially supporting code generation for certain microservice/module types

    Steps to Resolve

    1. Check Your DbContext for Duplicates or Irregularities

      • Ensure there are no duplicate DbSet properties or malformed code in your DbContext file.
      • Example of problematic code:
        public DbSet<MyEntity> MyEntities { get; set; }
        public DbSet<MyEntity> MyEntities { get; set; } // Duplicate!
        
      • Remove any duplicate or invalid lines.
    2. Revert Manual Changes

      • If you have manually edited files generated by Suite, try reverting those changes or regenerating the module from scratch.
    3. Update ABP Suite

      • Make sure you are using the latest version of ABP Suite that matches your ABP Framework version. Sometimes, updating Suite resolves parsing issues.
    4. Remove and Re-Add Solution in Suite

      • Remove your solution from ABP Suite and add it again. This can clear Suite's internal cache and force it to re-scan your project.
    5. Check Module Support

      • ABP Suite does not officially support CRUD code generation for certain microservice modules (e.g., SaasService, IdentityService, AdministrationService). If you are targeting these, code generation may not work as expected.
    6. Check for Known Issues

    7. Try with a Clean Project

      • Create a new ABP solution and test CRUD generation. If it works, compare the structure and code of your failing project to the new one to identify differences.

    If the Issue Persists

    • If you are using a microservice module not officially supported by Suite, you may need to perform CRUD scaffolding manually.
    • If you believe this is a bug, report it with a minimal reproducible example to the ABP team.

    Sources:


    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
    david1 created

    Regarding the auto-response suggestions: I checked DbContext for duplicate lines although the entire solution compiles successfully so there are no compilation issues causing it. Furthermore, I have done a full re-install of ABP Suite (both Microsoft Store version and standalone installer) so this should've cleared the internal ABP Suite cache as well.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [david1] said: Regarding the auto-response suggestions: I checked DbContext for duplicate lines although the entire solution compiles successfully so there are no compilation issues causing it. Furthermore, I have done a full re-install of ABP Suite (both Microsoft Store version and standalone installer) so this should've cleared the internal ABP Suite cache as well.

    Hi, the issue isn’t with the code generation itself, but rather during the validation of the solution/projects that happens before the generation starts. That’s why you see this error message, even though the code generation completes successfully.

    I’ll go ahead and create an issue for this. Thanks for reporting it!

  • User Avatar
    0
    david1 created

    I don't believe the CRUD page generator is actually generating any code successfully because it is crashing before completing even step 1 (out of 10 steps). Is there somehow I can check what is causing the validation to fail that I can check and resolve?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [david1] said: I don't believe the CRUD page generator is actually generating any code successfully because it is crashing before completing even step 1 (out of 10 steps). Is there somehow I can check what is causing the validation to fail that I can check and resolve?

    After the error occurs during the first step, does the code generation still continue and show you an information dialog?

    In my case, it threw a similar error but still completed the code generation and displayed an information dialog indicating success. I reviewed the generated code, and everything looked correct — I was even able to run the application and test it without issues.

    I found that the root cause was a project I had moved on my machine, which was still pointing to its old location in the Suite's appsettings.json file (this file keeps a list of all solutions added to Suite). Once I corrected the path in that file, the problem was resolved.

    Could you check if the same applies in your case?

  • User Avatar
    0
    david1 created

    No, it doesn't seem to be the case for me. It errors at step 1, shows an internal error, and no code is updated. I even tried setting up a new env (new ABP, new clone of repo, etc.) on another machine and I'm getting the same error. I tried even going to prior commits in our history to see if it works but somehow it's still showing this error. I've done a re-install of ABP on this machine and so I don't think the Suite's appsettings.json is the cause for me (since the recent solutions added to Suite was cleared out on re-install).

    Any more suggestions? I only noticed this issue when going to ABP Suite 1.0.1 recently in the last week. Is there a way to download an older Suite to see if the issue goes away e.g. 1.0.0 or 0.9.x?

  • User Avatar
    0
    david1 created

    Just tested it on older 0.9.25 versions and same issue. Also tested on a separate machine. Leads me to believe there's some kind of config file being read in our project that it doesn't like in the backend generation step (unchecking the backend generation step allows the latter steps to continue). Any way I can isolate what file it's encountering that it doesn't like?

    I presume it's somewhere in the code in these sections of the Volo ABP Suite although I don't have access to the source code to diagnose it (Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync):

       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.CBf4WQwZkH(Boolean  , String  , String  )
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.gb34LXPXOW(Boolean  )
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.uuX4U4GI2l()
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.ExecuteAsync(CrudPageCommandOptions options)
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.CommandManager.ExecuteAllAsync(CrudPageCommandOptions options)
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.GenerateAsync(EntityModel entity, Solution solution, EntityModel masterEntity, List`1 navigationConnections)
       at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync(Guid solutionId, EntityModel entity)
       at lambda_method2077(Closure, Object)
    
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [david1] said: Just tested it on older 0.9.25 versions and same issue. Also tested on a separate machine. Leads me to believe there's some kind of config file being read in our project that it doesn't like in the backend generation step (unchecking the backend generation step allows the latter steps to continue). Any way I can isolate what file it's encountering that it doesn't like?

    I presume it's somewhere in the code in these sections of the Volo ABP Suite although I don't have access to the source code to diagnose it (Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync):

       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.CBf4WQwZkH(Boolean  , String  , String  ) 
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.gb34LXPXOW(Boolean  ) 
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.uuX4U4GI2l() 
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.ExecuteAsync(CrudPageCommandOptions options) 
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.CommandManager.ExecuteAllAsync(CrudPageCommandOptions options) 
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.GenerateAsync(EntityModel entity, Solution solution, EntityModel masterEntity, List`1 navigationConnections) 
       at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync(Guid solutionId, EntityModel entity) 
       at lambda_method2077(Closure, Object) 
    

    Please, share your entity metadata (under .suite folder of your solution) and solution information (appsettings.json file under the .abp/suite folder).

  • User Avatar
    0
    david1 created

    It seems to occur on any module's entities in our solution. However, for your reference, here's one entity metadata from a module that only has this as its single module entity:

    Employee.json

    {
      "Id": "ac358ef6-6621-4939-b402-bc359cc57333",
      "Name": "Employee",
      "OriginalName": "Employee",
      "NamePlural": "Employees",
      "DatabaseTableName": "Employees",
      "Namespace": "Employees",
      "Type": 1,
      "MasterEntityName": null,
      "MasterEntity": null,
      "BaseClass": "FullAuditedAggregateRoot",
      "PageTitle": "Employees",
      "MenuIcon": "users",
      "PrimaryKeyType": "Guid",
      "PreserveCustomCode": true,
      "IsMultiTenant": true,
      "CheckConcurrency": true,
      "BulkDeleteEnabled": true,
      "ShouldCreateUserInterface": true,
      "ShouldCreateBackend": true,
      "ShouldExportExcel": true,
      "ShouldAddMigration": true,
      "ShouldUpdateDatabase": true,
      "CreateTests": true,
      "Properties": [
        {
          "Id": "a60e834b-11ca-480d-8749-4fc215676d89",
          "Name": "FirstName",
          "Type": "string",
          "EnumType": "",
          "EnumNamespace": "",
          "EnumAngularImport": "shared/enums",
          "EnumFilePath": null,
          "DefaultValue": null,
          "IsNullable": false,
          "IsRequired": true,
          "IsFilterable": true,
          "AllowEmptyStrings": false,
          "IsTextArea": false,
          "MinLength": null,
          "MaxLength": 1023,
          "SortOrder": 0,
          "SortType": 0,
          "Regex": "",
          "EmailValidation": false,
          "ShowOnList": true,
          "ShowOnCreateModal": true,
          "ShowOnEditModal": true,
          "ReadonlyOnEditModal": false,
          "EnumValues": null,
          "IsSelected": true,
          "MaxFileSize": null,
          "OrdinalIndex": 0
        },
        {
          "Id": "6a90e9d6-8a5c-4703-9132-b98e4da2d622",
          "Name": "MiddleName",
          "Type": "string",
          "EnumType": "",
          "EnumNamespace": "",
          "EnumAngularImport": "shared/enums",
          "EnumFilePath": null,
          "DefaultValue": "1023",
          "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": "ebfc8fa3-0d72-4d08-abcd-5d211aea8968",
          "Name": "LastName",
          "Type": "string",
          "EnumType": "",
          "EnumNamespace": "",
          "EnumAngularImport": "shared/enums",
          "EnumFilePath": null,
          "DefaultValue": null,
          "IsNullable": false,
          "IsRequired": true,
          "IsFilterable": true,
          "AllowEmptyStrings": false,
          "IsTextArea": false,
          "MinLength": null,
          "MaxLength": 1023,
          "SortOrder": 0,
          "SortType": 0,
          "Regex": "",
          "EmailValidation": false,
          "ShowOnList": true,
          "ShowOnCreateModal": true,
          "ShowOnEditModal": true,
          "ReadonlyOnEditModal": false,
          "EnumValues": null,
          "IsSelected": true,
          "MaxFileSize": null,
          "OrdinalIndex": 0
        },
        {
          "Id": "01dcdcdb-76aa-4828-becf-def33aad2c20",
          "Name": "IsActive",
          "Type": "bool",
          "EnumType": "",
          "EnumNamespace": "",
          "EnumAngularImport": "shared/enums",
          "EnumFilePath": null,
          "DefaultValue": "true",
          "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": "90d3c847-a918-4784-b66a-79f53621197a",
          "Name": "EmployeeNumber",
          "Type": "string",
          "EnumType": "",
          "EnumNamespace": "",
          "EnumAngularImport": "shared/enums",
          "EnumFilePath": null,
          "DefaultValue": null,
          "IsNullable": false,
          "IsRequired": true,
          "IsFilterable": true,
          "AllowEmptyStrings": false,
          "IsTextArea": false,
          "MinLength": null,
          "MaxLength": 1023,
          "SortOrder": 0,
          "SortType": 0,
          "Regex": "",
          "EmailValidation": false,
          "ShowOnList": true,
          "ShowOnCreateModal": true,
          "ShowOnEditModal": true,
          "ReadonlyOnEditModal": false,
          "EnumValues": null,
          "IsSelected": true,
          "MaxFileSize": null,
          "OrdinalIndex": 0
        },
        {
          "Id": "27b142b5-c1c0-4064-ae22-21e492b22f35",
          "Name": "UserId",
          "Type": "Guid",
          "EnumType": "",
          "EnumNamespace": "",
          "EnumAngularImport": "shared/enums",
          "EnumFilePath": null,
          "DefaultValue": null,
          "IsNullable": true,
          "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
        }
      ],
      "NavigationProperties": [],
      "NavigationConnections": [],
      "ChildEntities": [],
      "PhysicalFileName": "Employee.json"
    }
    

    appsettings.json (I have cleared and re-generated this and the problem persists):

    {
      "IsDotnetEfCoreToolInstalled": true,
      "Solutions": [
        {
          "Id": "cc238d75-f51b-48f1-b268-c0638d294513",
          "Name": "HumanResources",
          "UiFramework": 3,
          "ProjectNameWithCompanyName": "HumanResources",
          "OnlyProjectName": "HumanResources",
          "MvcProjectName": "HumanResources",
          "Path": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\HumanResources.sln",
          "RootProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources",
          "SrcFolderDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src",
          "TestFolderDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\test",
          "IsMicroserviceNolayerProject": false,
          "NolayerProjectDirectory": null,
          "NolayerContractsProjectDirectory": null,
          "WebProjectDirectory": null,
          "DomainProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.Domain",
          "DomainSharedProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.Domain.Shared",
          "ApplicationProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.Application",
          "ApplicationContractsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.Application.Contracts",
          "EntityFrameworkCoreProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.EntityFrameworkCore",
          "MongoDbProjectDirectory": null,
          "EntityFrameworkCoreDbMigrationsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.EntityFrameworkCore",
          "MongoDbTestsProjectDirectory": null,
          "EntityFrameworkCoreTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\test\\HumanResources.EntityFrameworkCore.Tests",
          "DomainTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\test\\HumanResources.Domain.Tests",
          "ApplicationTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\test\\HumanResources.Application.Tests",
          "TestBaseProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\test\\HumanResources.TestBase",
          "MigratorProjectDirectory": null,
          "MigratorCsprojFileName": "HumanResources.DbMigrator.csproj",
          "AngularSolutionRootPath": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\angular",
          "DefaultNamespace": "HumanResources",
          "DefaultNamespaceAsCamelCase": "humanResources",
          "MigrationsMigrationsDbContext": "HumanResourcesMigrationsDbContext",
          "TenantMigrationsMigrationsDbContext": "HumanResourcesTenantMigrationsDbContext",
          "DbContextFilePath": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.EntityFrameworkCore\\EntityFrameworkCore\\HumanResourcesDbContext.cs",
          "TenantDbContextFilePath": null,
          "DbContextModelCreatingExtensionsFilePath": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.EntityFrameworkCore\\EntityFrameworkCore\\HumanResourcesCustomDbContextModelCreatingExtensions.cs",
          "HttpApiHostProjectDirectory": null,
          "HttpApiProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.HttpApi",
          "HttpApiClientProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\humanresources\\src\\HumanResources.HttpApi.Client",
          "BlazorProjectDirectory": null,
          "MauiBlazorProjectDirectory": null,
          "BlazorWebAppProjectDirectory": null,
          "StartupProjectDirectory": null,
          "StartupProjectName": null,
          "DatabaseProvider": 1,
          "DatabaseProviderName": "EntityFrameworkCore",
          "UiFrameworkName": "Angular",
          "ApplicationContractsExists": true,
          "MigratorProjectExists": false,
          "UpdateDatabaseMethod": 1,
          "IsTieredArchitecture": false,
          "ActiveDate": "2025-06-20T11:24:53.5511006-06:00",
          "ProjectTemplateType": 2,
          "AbpVersion": "9.2.0"
        }
      ]
    }
    
  • User Avatar
    0
    david1 created

    FYI Creating a new DDD module in our project (v9.2.0) called Sample appears to work OK in the ABP Suite CRUD page generator all the way through to step 10 with a simple entity like so:

    Sample entity model:

    {
      "Id": "e59dd991-ab00-49b2-9917-519a83b22167",
      "Name": "Sample",
      "OriginalName": "Sample",
      "NamePlural": "Samples",
      "DatabaseTableName": "Samples",
      "Namespace": "Samples",
      "Type": 1,
      "MasterEntityName": null,
      "MasterEntity": null,
      "BaseClass": "FullAuditedAggregateRoot",
      "PageTitle": "Samples",
      "MenuIcon": "file-alt",
      "PrimaryKeyType": "Guid",
      "PreserveCustomCode": true,
      "IsMultiTenant": false,
      "CheckConcurrency": true,
      "BulkDeleteEnabled": true,
      "ShouldCreateUserInterface": true,
      "ShouldCreateBackend": true,
      "ShouldExportExcel": true,
      "ShouldAddMigration": true,
      "ShouldUpdateDatabase": true,
      "CreateTests": true,
      "Properties": [
        {
          "Id": "3d6b9e71-68b2-4f57-bb7b-7b5f92eb06b1",
          "Name": "Name",
          "Type": "string",
          "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
        }
      ],
      "NavigationProperties": [],
      "NavigationConnections": [],
      "ChildEntities": [],
      "PhysicalFileName": "Sample.json"
    }
    

    appsettings.json

    
        {
          "Id": "4606a7ad-b3c5-4986-8d29-6ad4b4aa0bee",
          "Name": "Sample",
          "UiFramework": 3,
          "ProjectNameWithCompanyName": "Sample",
          "OnlyProjectName": "Sample",
          "MvcProjectName": "Sample",
          "Path": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\Sample.sln",
          "RootProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample",
          "SrcFolderDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src",
          "TestFolderDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test",
          "IsMicroserviceNolayerProject": false,
          "NolayerProjectDirectory": null,
          "NolayerContractsProjectDirectory": null,
          "WebProjectDirectory": null,
          "DomainProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.Domain",
          "DomainSharedProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.Domain.Shared",
          "ApplicationProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.Application",
          "ApplicationContractsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.Application.Contracts",
          "EntityFrameworkCoreProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.EntityFrameworkCore",
          "MongoDbProjectDirectory": null,
          "EntityFrameworkCoreDbMigrationsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.EntityFrameworkCore",
          "MongoDbTestsProjectDirectory": null,
          "EntityFrameworkCoreTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test\\Sample.EntityFrameworkCore.Tests",
          "DomainTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test\\Sample.Domain.Tests",
          "ApplicationTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test\\Sample.Application.Tests",
          "TestBaseProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test\\Sample.TestBase",
          "MigratorProjectDirectory": null,
          "MigratorCsprojFileName": "Sample.DbMigrator.csproj",
          "AngularSolutionRootPath": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\angular",
          "DefaultNamespace": "Sample",
          "DefaultNamespaceAsCamelCase": "sample",
          "MigrationsMigrationsDbContext": "SampleMigrationsDbContext",
          "TenantMigrationsMigrationsDbContext": "SampleTenantMigrationsDbContext",
          "DbContextFilePath": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.EntityFrameworkCore\\EntityFrameworkCore\\ISampleDbContext.cs",
          "TenantDbContextFilePath": null,
          "DbContextModelCreatingExtensionsFilePath": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.EntityFrameworkCore\\EntityFrameworkCore\\SampleDbContextModelCreatingExtensions.cs",
          "HttpApiHostProjectDirectory": null,
          "HttpApiProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.HttpApi",
          "HttpApiClientProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.HttpApi.Client",
          "BlazorProjectDirectory": null,
          "MauiBlazorProjectDirectory": null,
          "BlazorWebAppProjectDirectory": null,
          "StartupProjectDirectory": null,
          "StartupProjectName": null,
          "DatabaseProvider": 1,
          "DatabaseProviderName": "EntityFrameworkCore",
          "UiFrameworkName": "Angular",
          "ApplicationContractsExists": true,
          "MigratorProjectExists": false,
          "UpdateDatabaseMethod": 1,
          "IsTieredArchitecture": false,
          "ActiveDate": "2025-06-20T11:42:38.6839382-06:00",
          "ProjectTemplateType": 2,
          "AbpVersion": "9.2.0"
        }
    

    That said, simply removing all the fields except one field from the Employees entity model and attempting to run "Save and generate" still fails with the same error (so perhaps it's related to a config of the "older" DDD modules we have in our project that is somehow different to the newer specification for 9.2.0+ ?)

    2025-06-20 11:47:58.080 -06:00 [INF] 1/10 - EntityGenerateCommand started...
    2025-06-20 11:47:58.146 -06:00 [ERR] ---------- RemoteServiceErrorInfo ----------
    {
      "code": null,
      "message": "An internal error occurred during your request!",
      "details": null,
      "data": null,
      "validationErrors": null
    }
    
    2025-06-20 11:47:58.146 -06:00 [ERR] startIndex ('-1') must be a non-negative value. (Parameter 'startIndex')
    Actual value was -1.
    System.ArgumentOutOfRangeException: startIndex ('-1') must be a non-negative value. (Parameter 'startIndex')
    Actual value was -1.
       at System.ArgumentOutOfRangeException.ThrowNegative[T](T value, String paramName)
       at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
       at System.String.Substring(Int32 startIndex)
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.CBf4WQwZkH(Boolean  , String  , String  )
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.gb34LXPXOW(Boolean  )
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.uuX4U4GI2l()
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.ExecuteAsync(CrudPageCommandOptions options)
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.CommandManager.ExecuteAllAsync(CrudPageCommandOptions options)
       at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.GenerateAsync(EntityModel entity, Solution solution, EntityModel masterEntity, List`1 navigationConnections)
       at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync(Guid solutionId, EntityModel entity)
       at lambda_method2034(Closure, Object)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeActionMethodAsync&gt;g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    2025-06-20 11:47:58.152 -06:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
    2025-06-20 11:47:58.152 -06:00 [INF] Executed action Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync (Volo.Abp.Suite) in 732.5153ms
    2025-06-20 11:47:58.152 -06:00 [INF] Executed endpoint 'Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync (Volo.Abp.Suite)'
    2025-06-20 11:47:58.152 -06:00 [INF] Request finished HTTP/1.1 POST http://localhost:3000/api/abpSuite/crudPageGenerator/cc238d75-f51b-48f1-b268-c0638d294513/save-and-generate-entity - 500 null application/json; charset=utf-8 732.8687ms
    
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    so perhaps it's related to a config of the "older" DDD modules we have in our project that is somehow different to the newer specification for 9.2.0+ ?

    Hi, yes, actually I suspect this. I'll try it with your config and let you know about the status of the issue.

  • User Avatar
    0
    david1 created

    FYI Creating a new DDD module in our project (v9.2.0) called Sample appears to work OK in the ABP Suite CRUD page generator all the way through to step 10 with a simple entity like so:

    Sample entity model:

    {
      "Id": "e59dd991-ab00-49b2-9917-519a83b22167",
      "Name": "Sample",
      "OriginalName": "Sample",
      "NamePlural": "Samples",
      "DatabaseTableName": "Samples",
      "Namespace": "Samples",
      "Type": 1,
      "MasterEntityName": null,
      "MasterEntity": null,
      "BaseClass": "FullAuditedAggregateRoot",
      "PageTitle": "Samples",
      "MenuIcon": "file-alt",
      "PrimaryKeyType": "Guid",
      "PreserveCustomCode": true,
      "IsMultiTenant": false,
      "CheckConcurrency": true,
      "BulkDeleteEnabled": true,
      "ShouldCreateUserInterface": true,
      "ShouldCreateBackend": true,
      "ShouldExportExcel": true,
      "ShouldAddMigration": true,
      "ShouldUpdateDatabase": true,
      "CreateTests": true,
      "Properties": [
        {
          "Id": "3d6b9e71-68b2-4f57-bb7b-7b5f92eb06b1",
          "Name": "Name",
          "Type": "string",
          "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
        }
      ],
      "NavigationProperties": [],
      "NavigationConnections": [],
      "ChildEntities": [],
      "PhysicalFileName": "Sample.json"
    }
    

    appsettings.json

    
        {
          "Id": "4606a7ad-b3c5-4986-8d29-6ad4b4aa0bee",
          "Name": "Sample",
          "UiFramework": 3,
          "ProjectNameWithCompanyName": "Sample",
          "OnlyProjectName": "Sample",
          "MvcProjectName": "Sample",
          "Path": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\Sample.sln",
          "RootProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample",
          "SrcFolderDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src",
          "TestFolderDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test",
          "IsMicroserviceNolayerProject": false,
          "NolayerProjectDirectory": null,
          "NolayerContractsProjectDirectory": null,
          "WebProjectDirectory": null,
          "DomainProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.Domain",
          "DomainSharedProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.Domain.Shared",
          "ApplicationProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.Application",
          "ApplicationContractsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.Application.Contracts",
          "EntityFrameworkCoreProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.EntityFrameworkCore",
          "MongoDbProjectDirectory": null,
          "EntityFrameworkCoreDbMigrationsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.EntityFrameworkCore",
          "MongoDbTestsProjectDirectory": null,
          "EntityFrameworkCoreTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test\\Sample.EntityFrameworkCore.Tests",
          "DomainTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test\\Sample.Domain.Tests",
          "ApplicationTestsProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test\\Sample.Application.Tests",
          "TestBaseProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\test\\Sample.TestBase",
          "MigratorProjectDirectory": null,
          "MigratorCsprojFileName": "Sample.DbMigrator.csproj",
          "AngularSolutionRootPath": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\angular",
          "DefaultNamespace": "Sample",
          "DefaultNamespaceAsCamelCase": "sample",
          "MigrationsMigrationsDbContext": "SampleMigrationsDbContext",
          "TenantMigrationsMigrationsDbContext": "SampleTenantMigrationsDbContext",
          "DbContextFilePath": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.EntityFrameworkCore\\EntityFrameworkCore\\ISampleDbContext.cs",
          "TenantDbContextFilePath": null,
          "DbContextModelCreatingExtensionsFilePath": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.EntityFrameworkCore\\EntityFrameworkCore\\SampleDbContextModelCreatingExtensions.cs",
          "HttpApiHostProjectDirectory": null,
          "HttpApiProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.HttpApi",
          "HttpApiClientProjectDirectory": "C:\\git\\fabwerx\\Fabwerx\\modules\\sample\\src\\Sample.HttpApi.Client",
          "BlazorProjectDirectory": null,
          "MauiBlazorProjectDirectory": null,
          "BlazorWebAppProjectDirectory": null,
          "StartupProjectDirectory": null,
          "StartupProjectName": null,
          "DatabaseProvider": 1,
          "DatabaseProviderName": "EntityFrameworkCore",
          "UiFrameworkName": "Angular",
          "ApplicationContractsExists": true,
          "MigratorProjectExists": false,
          "UpdateDatabaseMethod": 1,
          "IsTieredArchitecture": false,
          "ActiveDate": "2025-06-20T11:42:38.6839382-06:00",
          "ProjectTemplateType": 2,
          "AbpVersion": "9.2.0"
        }```
    
  • User Avatar
    0
    david1 created

    I also sent sumeyye.kurtulus in one of my other tickets an email with a link to my complete project as-is. I can send you this project as well to see if you can reproduce that error on your end? If that's helpful please let me know your email so that I can send it to you privately.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [david1] said: I also sent sumeyye.kurtulus in one of my other tickets an email with a link to my complete project as-is. I can send you this project as well to see if you can reproduce that error on your end? If that's helpful please let me know your email so that I can send it to you privately.

    Actually, this can be better to reproduce the problem. Please send the project to support@abp.io with the ticket number, and I'll look into it and write you back asap.

  • User Avatar
    0
    david1 created

    Thanks, I've sent an email and description to that support email now.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [david1] said: Thanks, I've sent an email and description to that support email now.

    Thanks, I got your project. I'll write you back in an hour.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi again, thank you for sharing the project and all the detailed information. I've reproduced the problem, and it seems there is a wrong dbcontext logic in ABP Suite.

    You have two classes: CoreCustomDbContextModelCreatingExtensions and CoreDbContextModelCreatingExtensions, and ABP Suite is currently unable to understand the difference. So, for a quick workaround, you can delete the CoreDbContextModelCreatingExtensions and move the ConfigureCore method to the other file.

    Then, when you generate it, it should generate successfully:


    I'll create an issue for this and we will fix it asap, but for now, you can go with a single *DbContextModelCreatingExtesions class.

    Regards.

  • User Avatar
    0
    david1 created

    This is good news. Thanks for isolating the cause of the error. If there's some way for us to be able to see this kind of error output that would help us isolate the cause of the issue that would greatly help us in the future.

    As for the specific reason we have a separate custom config file, we observed that the ABP Suite CRUD generator overwrites all customizations to the file (e.g. CoreDbContextModelCreatingExtensions#ConfigureCore is overwritten on every re-generation).

    We want to have overrides to the EF Core configurations so we have a separate CoreCustomDbContextModelCreatingExtensions#ConfigureCoreManually method to do that. I understand you said to copy over what's auto-generated from the CoreDbContextModelCreatingExtensions into our customized extensions but is there a recommended approach to actually performing these kind of EF Core customizations after the auto-generated ones?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    If there's some way for us to be able to see this kind of error output that would help us isolate the cause of the issue that would greatly help us in the future.

    I totally agree! We should enhance the exception logic and show meaningful errors in any case. We have an issue for that and we need to prioritize it, i've taken note for that.

    As for the specific reason we have a separate custom config file, we observed that the ABP Suite CRUD generator overwrites all customizations to the file (e.g. CoreDbContextModelCreatingExtensions#ConfigureCore is overwritten on every re-generation). We want to have overrides to the EF Core configurations so we have a separate CoreCustomDbContextModelCreatingExtensions#ConfigureCoreManually method to do that. I understand you said to copy over what's auto-generated from the CoreDbContextModelCreatingExtensions into our customized extensions but is there a recommended approach to actually performing these kind of EF Core customizations after the auto-generated ones?

    Unfortunately, we did not cover code customization for the *DbContextModelCreatingExtensions.cs file. I'll create an issue for that, and we probably will add a placeholder to let you write your own db configurations or add a new *.Extended.cs file to cover customization.

    In the meantime, your approach seems correct. As far as I understand, you are overriding/extending the default db configurations within the CoreManually method, and for now, it seems that it's the only way for that. After we implemented the customization for that file, then you may want to move your configs between the placeholders or in the *.Extended.cs file.

    Regards.

  • User Avatar
    0
    trendline created

    I have occurred the same issue with abp suite version 9.2.1 on microservice module generation. I have checked the DbContext with the above mentioned, no problem with my code, but it still failed.

  • User Avatar
    0
    david1 created

    @EngincanV is there also some way to be notified when this issue will be fixed? For example, is there a GitHub issue that we can follow to be notified when it's fixed in an upcoming release?

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.0.0-preview. Updated on July 11, 2025, 11:35