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)
-
0
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.
-
0
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 contextThis happens in your
ProductCreateDto.csandProductUpdateDto.csfiles.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
ProductConstsclass and where the DTOs expect it to be: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;In
EntityGenerateCommand.cs(line 212), theProductConstsclass 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 asCloudCrm2.CatalogService.Products.ProductConsts.Workaround
Since the ABP team is working on a fix, here are your options:
Option 1: Manually Fix the Consts Namespace
Create a
ProductConsts.csfile 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; } }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 alternativelyEntityGenerateCommand.csshould add.Entities.prefix to match.The correct namespace for microservice templates should be:
CloudCrm2.CatalogService.Products.ProductConsts(notCloudCrm2.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.
-
0
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.3the problem will be gone.abp suite update