Open Closed

Missing ...MenuContributor.cs After Creating New Microservice and Blazor UI #9402


User avatar
0
yunusemrecaglar created

I created a new microservice and also generated a Blazor Server UI project for it. Then, I updated the frontend configuration of this new service in the .abp/suite/appsettings.json file to point to the newly created Pbys.Blazor.Server project instead of the existing microservice Blazor Server project.

However, when I try to build the solution, I get the following error:

Cannot find pbysMenuContributor.cs file! Ensure ..\AbpSolution12\apps\Pbys\AbpSolution12.Blazor.Server\Menus\pbysMenuContributor.cs exists.


6 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Can you please provide your solution structure and build logs here?

    Does dotnet CLI say Menucontributor not found? Or you did not found it?

    build operation doesn't look for a specific file unless you define its name in the csproj file. You can check the related project's csproj file if there is a pbysMenuContributor.cs file defined.

    Or like other hand, if you cannot find it in the project, you can create a new one that implements the IMenuContributor and configure it in the Module.cs file

    Configure<AbpNavigationOptions>(options =>
    {
        options.MenuContributors.Add(new MyProjectMenuContributor());
    });
    
  • User Avatar
    0
    yunusemrecaglar created

    The error message says that the file pbysMenuContributor.cs cannot be found at ..\AbpSolution12\apps\Pbys\AbpSolution12.Blazor.Server\Menus\pbysMenuContributor.cs. However, this is the original Blazor Server project that was automatically created when the microservice was first generated. I have now created a new Blazor Server project, and I want the code to be generated in this new project instead.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi @yunusemrecaglar, Just to clarify—now that you've created a new Blazor Server project, has that resolved your issue, or do you still need assistance? Let us know how we can help.

    Otherwise I can refund your ticket and close this issue since it was project generation problem on our side

  • User Avatar
    0
    yunusemrecaglar created

    The issue is not related to project creation. I can successfully create the project. However, when I try to add a service and create an entity through ABP Suite, the entity is properly added to the initially created Blazor project. But when I try to generate the entity code for a Blazor Server project that I manually added later, I get an error like the one I mentioned earlier.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi again, I reached out to the ABP Suite team, and they clarified that ABP Suite generates code for a single UI—the main UI selected during project creation. However, if you create a module template, Suite can generate code for multiple UIs, but only within the module template.

    So, the issue seems to stem from this design choice: ABP Suite is structured to generate code for the primary application UI, not additional UIs added manually later.

  • User Avatar
    0
    yunusemrecaglar created

    Understood, can you please refund the ticket?

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 v9.3.0-preview. Updated on June 13, 2025, 11:37