Open Closed

CRUD Page Generator not producing Angular controller file in the right path #9166


User avatar
0
david1 created

I am using the CRUD Page Generator to produce models and it appears that the generated output is expecting the proxy path for the Angular service to be under a "controllers" folder; however, they are being generated just in the root HttpApi project instead. This error sounds very similar to issue reported in 2021: https://github.com/abpframework/abp/issues/9904

// Generated path below:
import { WorkAreaService } from '../../../proxy/core/controllers/work-areas/work-area.service';
// Correct path that it should be:
import { WorkAreaService } from '../../../proxy/core/work-areas/work-area.service';

export abstract class AbstractWorkAreaViewService {
  protected readonly proxyService = inject(WorkAreaService);
  protected readonly confirmationService = inject(ConfirmationService);
  protected readonly list = inject(ListService);

  data: PagedResultDto<WorkAreaDto> = {
    items: [],
    totalCount: 0,
  };

  filters = {} as GetWorkAreasInput;

  delete(record: WorkAreaDto) { ... }

  hookToQuery() { ... }

  clearFilters() { ... }
}

Not sure if the WorkArea should be under Core.Http > Controllers > WorkAreas but when the CRUD generator is run (and re-run), it's placing the WorkArea controller service under Core.Http > WorkAreas:

  • Exception message and full stack trace:
  • Steps to reproduce the issue:

2 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, thanks for reporting this. Indeed, it should be under the controllers folder. I'll create an issue for that, but can you share your solution structure, so we can better test it?

  • User Avatar
    0
    david1 created

    Hi, I just created a project from scratch, upgraded to 9.2.0-rc.2, and then save and generated a new CRUD page with the generator (named WorkArea) and unfortunately wasn't able to reproduce the issue.

    The following worked fine as expected when generated WorkArea in the MAIN project:

    1. Generated service file is located here: Abp9166\angular\src\app\proxy\work-areas\work-area.service.ts
    2. Generated service file (Abp9166\angular\src\app\work-areas\work-area\services\work-area.abstract.service.ts) references import as: import { WorkAreaService } from '../../../proxy/work-areas/work-area.service'; (no controller in path)

    So it seems that there is something misconfigured perhaps from my older project based on an earlier 9.0.3 ABP version I think?

    Workaround that seemed to work for me:

    • I've copied the the folder under angular\.suite\schematics from the new project to my old project and deleted the generate-proxy.json from the src\proxy\ folder and it seems to be generating the path correctly now without the controllers in the path.
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
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 May 12, 2025, 05:22