Open Closed

Referencing Enums in MongoDB #2477


User avatar
0
james@melvin.tech created
  • ABP Framework version: v5.1.1
  • UI type: MVC
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: Cannot find namespace of this enum! Write the namespace of this enum into the file.
  • Steps to reproduce the issue:" Create a new MongoDb tiered solution. Add a enum file in the Domain.Shared filder. Generate a CRUD page referencing the Enum. Then if i set the Enum namespace and Enum name to match the file, i get the following error.
  • Cannot populate enum localizations! Error code: EN0004. System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.sI1wyT4PYy()

Ive built the project, tried different namespaces but no matter what i cant link to a enum.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    Hi @james

    There is a known problem with parsing enum files, it will be fixed in the next patch. I'm refunding your question credit.


    Urgent solution: Change the enum file to file-scoped namespace

    example:

    namespace MyApplication.Cars;
    
    public enum CarType
    {
        Sedan,
        StationWagon,
        Coupe
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
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.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.