Open Closed

Issue Ticket no: 10312 , What can i do next ? #10385


User avatar
0
kwanp created

Hi Issue Ticket no: 10312 , What can i do next ? https://abp.io/support/questions/10312/Error-when-Save-and-Generate-Class-with-Abp-Suite

Thank you


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

    Please use the official support ticket page to continue with ticket #10312 (add the requested details/logs, follow up with replies, or ask for status updates). I can’t access or act on tickets from here, and ABP support staff can only continue the process inside that ticket thread.

    If you need to escalate or you’ve run out of question credits / need account-level help, contact ABP via:

    • https://abp.io/contact

    (Your ticket link is reachable: https://abp.io/support/questions/10312/Error-when-Save-and-Generate-Class-with-Abp-Suite)


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

    ticket #10312 has been locked

    Please help

    Thank you

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi there! I can see you're encountering an error with ABP Suite when generating DTOs for your microservice template. The error is:

    error CS0103: The name 'ProductConsts' does not exist in the current context
    

    This happens in your ProductCreateDto.cs and ProductUpdateDto.cs files.

    Root Cause

    This is a confirmed bug in ABP Suite (issue was reproduced by the ABP support team).

    The problem is a namespace mismatch between where ABP Suite generates the ProductConsts class and where the DTOs expect it to be:

    1. In AppServiceCommand.cs (lines 759-767 and 814-822), ABP Suite adds a using statement for DTOs in microservice projects:

      // For microservice, it adds:
      using CloudCrm2.CatalogService.Entities.Products;
      
    2. In EntityGenerateCommand.cs (line 212), the ProductConsts class is generated with a different namespace:

      // Creates ProductConsts with namespace: CloudCrm2.CatalogService.Products
      // (Missing the ".Entities" part!)
      

    So the DTOs are looking for CloudCrm2.CatalogService.Entities.Products.ProductConsts, but the actual class is generated as CloudCrm2.CatalogService.Products.ProductConsts.

    Workaround

    Since the ABP team is working on a fix, here are your options:

    Option 1: Manually Fix the Consts Namespace

    1. Create a ProductConsts.cs file in your Domain project (or where the entity is) with the correct namespace:

      namespace CloudCrm2.CatalogService.Entities.Products
      {
          public static class ProductConsts
          {
              public const int NameMinLength = 2;
              public const int NameMaxLength = 120;
              public const int DescriptionMaxLength = 1000;
              public const int StockCountMinValue = 0;
              public const int StockCountMaxValue = 999999;
          }
      }
      
    2. After manually creating this file, you can use Save and Generate in ABP Suite - it will keep your manually created file.

    Option 2: Wait for the Fix

    The ABP support team has confirmed this is a bug and is working on a fix. You can track the progress on the ABP GitHub issues.

    Expected Fix

    The fix should be in AppServiceCommand.cs - the code should NOT add .Entities. prefix for microservice projects, or alternatively EntityGenerateCommand.cs should add .Entities. prefix to match.

    The correct namespace for microservice templates should be:

    • CloudCrm2.CatalogService.Products.ProductConsts (not CloudCrm2.CatalogService.Entities.Products.ProductConsts)

    Quick Checklist

    • This is a confirmed ABP Suite bug (not your code issue)
    • The fix is in the ABP Suite source code, not your project
    • Workaround: Create the Consts file manually with the .Entities. namespace prefix
    • After creating Consts manually, Save and Generate will work

    Note: The ABP support team has reproduced this issue and is working on a fix. This bug affects microservice templates when using ABP Suite to generate entities with validation properties (MinLength, MaxLength, etc.).

    I hope this helps! Let me know if you need any clarification.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi again,

    According to my investigations, the fix is already shipped in v10.0.3. If you update your abp suite to version 10.0.3 the problem will be gone.

    abp suite update
    
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 February 26, 2026, 13:35
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.