Open Closed

Error generating crud page #9659


User avatar
0
alboy created
  • ABP Framework version: v9.2.2
  • UI Type: Blazor Interactive Auto
  • Steps to reproduce the issue:

Hi everyone, I'm trying to generate a CRUD page inside ABP Suite, however I seem to be getting the following error instantly

2025-07-22 19:03:12.006 +01:00 [INF] Route matched with {controller = "crudPageGenerator", action = "SaveAndGenerateEntity", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.NoContentResult] SaveAndGenerateEntityAsync(System.Guid, Volo.Abp.Suite.Models.EntityModel) on controller Volo.Abp.Suite.Controllers.CrudPageGeneratorController (Volo.Abp.Suite). 2025-07-22 19:03:13.760 +01:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": null, "validationErrors": null }

2025-07-22 19:03:13.765 +01:00 [ERR] Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.wVOm75JTq2(Solution ) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.IeAm9nRiQI(Solution ) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.GenerateAsync(EntityModel entity, Solution solution, EntityModel masterEntity, List1 navigationConnections) at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync(Guid solutionId, EntityModel entity) at lambda_method2058(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, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.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.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 2025-07-22 19:03:13.781 +01:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. 2025-07-22 19:03:13.782 +01:00 [INF] Executed action Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync (Volo.Abp.Suite) in 1775.7351ms 2025-07-22 19:03:13.782 +01:00 [INF] Executed endpoint 'Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync (Volo.Abp.Suite)' 2025-07-22 19:03:13.782 +01:00 [INF] Request finished HTTP/1.1 POST http://localhost:3000/api/abpSuite/crudPageGenerator/71931eca-5761-4a80-bf5e-3edd5fefc77f/save-and-generate-entity - 500 null application/json; charset=utf-8 1778.7462ms

My suite, studio, cli is all up to date, as are my packages, everything is building. As far as I can tell, there is nothing fundamental about the project I've changed with regards to config. I did switch to central package management a month or so ago, but it's been fine generating entities in between then and now. I noticed this issue when I tried to create a new entity through the suite, after finding it didn't work, I tried to trim it down to a simple form (just one string property) and that still didn't work. And then I tried to edit an existing entity just to test it, that didn't work, and then I tried to save an entity I haven't made a change to. Which also didn't work. I just get this error every time.

I also tried upgrading to preview versions, and downgrading to previous versions, but it's the same error every time.

I can share logs, or entities if needs be.


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

    This error ("An internal error occurred during your request!" with a NullReferenceException in ABP Suite's CRUD Page Generator) is a known issue, especially in modular or microservice solutions, and is often related to the way ABP Suite parses your solution's structure and DbContext extension files.

    How to Resolve

    1. Check for Multiple *DbContextModelCreatingExtensions.cs Files

      • ABP Suite expects only one *DbContextModelCreatingExtensions.cs file per module. If you have more than one (e.g., both LeadsDbContextModelCreatingExtensions.cs and LeadsCustomDbContextModelCreatingExtensions.cs), Suite may fail with a NullReferenceException.
      • Solution: Keep only one such file per module and move all configuration methods into it.
    2. Verify File Paths in Suite Configuration

      • Ensure that your solution's .abp/suite/appsettings.json points to the correct paths for your DbContext and extension files.
      • If you have moved or renamed files, update the paths or remove and re-add your solution in Suite.
    3. Check for Missing or Misnamed Files

      • Make sure the expected files (like LeadsDbContextModelCreatingExtensions.cs) exist and are not excluded from the project.
    4. Remove and Re-Add Solution in Suite

      • Sometimes Suite caches old paths. Remove your solution from Suite and add it again to refresh its internal cache.
    5. Update to Latest Suite and ABP Version

      • Ensure both ABP Suite and your project packages are on the latest compatible versions.
    6. If You Need Custom EF Core Configurations

      • Since Suite overwrites the extension file, you can temporarily move your customizations to a separate method or file, then re-apply them after code generation.

    References and More Details

    These support threads contain detailed discussions and workarounds for similar issues.


    If you follow these steps and ensure only one *DbContextModelCreatingExtensions.cs file exists per module, the error should be resolved. If you need to keep custom configurations, consider merging them into the single extension file or waiting for an official fix that supports custom/extended files.


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

    [AI-Bot] said: This error ("An internal error occurred during your request!" with a NullReferenceException in ABP Suite's CRUD Page Generator) is a known issue, especially in modular or microservice solutions, and is often related to the way ABP Suite parses your solution's structure and DbContext extension files.

    How to Resolve

    1. Check for Multiple *DbContextModelCreatingExtensions.cs Files

      • ABP Suite expects only one *DbContextModelCreatingExtensions.cs file per module. If you have more than one (e.g., both LeadsDbContextModelCreatingExtensions.cs and LeadsCustomDbContextModelCreatingExtensions.cs), Suite may fail with a NullReferenceException.
      • Solution: Keep only one such file per module and move all configuration methods into it.
    2. Verify File Paths in Suite Configuration

      • Ensure that your solution's .abp/suite/appsettings.json points to the correct paths for your DbContext and extension files.
      • If you have moved or renamed files, update the paths or remove and re-add your solution in Suite.
    3. Check for Missing or Misnamed Files

      • Make sure the expected files (like LeadsDbContextModelCreatingExtensions.cs) exist and are not excluded from the project.
    4. Remove and Re-Add Solution in Suite

      • Sometimes Suite caches old paths. Remove your solution from Suite and add it again to refresh its internal cache.
    5. Update to Latest Suite and ABP Version

      • Ensure both ABP Suite and your project packages are on the latest compatible versions.
    6. If You Need Custom EF Core Configurations

      • Since Suite overwrites the extension file, you can temporarily move your customizations to a separate method or file, then re-apply them after code generation.

    References and More Details

    These support threads contain detailed discussions and workarounds for similar issues.


    If you follow these steps and ensure only one *DbContextModelCreatingExtensions.cs file exists per module, the error should be resolved. If you need to keep custom configurations, consider merging them into the single extension file or waiting for an official fix that supports custom/extended files.


    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.

    Just to respond to the bot

    1. There is no DbContextModelCreatingExtensions-esque file, and I'm not sure there ever was... Upon searching for it I can see it's a staple of the standard solution templates. But it's not in my solution.
    2. .abp/suite/appsettings.json seems to have all the correct paths after checking them, however I did notice that the version for this project is null?

    1. Again, LeadsDbContextModelCreatingExtensions this file doesn't exist. But again, it seems like it never did.
    2. I've removed and readded the solution to abp suite multiple times, made no difference
    3. As said in my original post, upgrades, downgrades, and preview builds have all been tried
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [alboy] said:

    [AI-Bot] said: This error ("An internal error occurred during your request!" with a NullReferenceException in ABP Suite's CRUD Page Generator) is a known issue, especially in modular or microservice solutions, and is often related to the way ABP Suite parses your solution's structure and DbContext extension files.

    How to Resolve

    1. Check for Multiple *DbContextModelCreatingExtensions.cs Files

      • ABP Suite expects only one *DbContextModelCreatingExtensions.cs file per module. If you have more than one (e.g., both LeadsDbContextModelCreatingExtensions.cs and LeadsCustomDbContextModelCreatingExtensions.cs), Suite may fail with a NullReferenceException.
      • Solution: Keep only one such file per module and move all configuration methods into it.
    2. Verify File Paths in Suite Configuration

      • Ensure that your solution's .abp/suite/appsettings.json points to the correct paths for your DbContext and extension files.
      • If you have moved or renamed files, update the paths or remove and re-add your solution in Suite.
    3. Check for Missing or Misnamed Files

      • Make sure the expected files (like LeadsDbContextModelCreatingExtensions.cs) exist and are not excluded from the project.
    4. Remove and Re-Add Solution in Suite

      • Sometimes Suite caches old paths. Remove your solution from Suite and add it again to refresh its internal cache.
    5. Update to Latest Suite and ABP Version

      • Ensure both ABP Suite and your project packages are on the latest compatible versions.
    6. If You Need Custom EF Core Configurations

      • Since Suite overwrites the extension file, you can temporarily move your customizations to a separate method or file, then re-apply them after code generation.

    References and More Details

    These support threads contain detailed discussions and workarounds for similar issues.


    If you follow these steps and ensure only one *DbContextModelCreatingExtensions.cs file exists per module, the error should be resolved. If you need to keep custom configurations, consider merging them into the single extension file or waiting for an official fix that supports custom/extended files.


    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.

    Just to respond to the bot

    1. There is no DbContextModelCreatingExtensions-esque file, and I'm not sure there ever was... Upon searching for it I can see it's a staple of the standard solution templates. But it's not in my solution.
    2. .abp/suite/appsettings.json seems to have all the correct paths after checking them, however I did notice that the version for this project is null?

    1. Again, LeadsDbContextModelCreatingExtensions this file doesn't exist. But again, it seems like it never did.
    2. I've removed and readded the solution to abp suite multiple times, made no difference
    3. As said in my original post, upgrades, downgrades, and preview builds have all been tried

    Hi, actually AbpVersion should not be null. ABP Suite builds your solution and determines the version normally, but it seems in your solution it could not do that. Can you please set the AbpVersion as 9.2.2 and try again to see if it works or not?

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 September 01, 2025, 08:37