Skip to content

ABP 10+ (Mapperly): Code generation still searches for *ApplicationAutoMapperProfile.cs (AutoMapper legacy) #209

@omer-repo

Description

@omer-repo

Title

ABP 10+ (Mapperly): Code generation still searches for *ApplicationAutoMapperProfile.cs (AutoMapper legacy)

Description

On ABP 10+ projects that migrated from AutoMapper to Mapperly, ABP Helper code generation still tries to find a file named like:

${ProjectName}ApplicationAutoMapperProfile.cs

If the file is missing (which is expected after migration to Mapperly), generation fails with FileNotFoundException.

Error

System.IO.FileNotFoundException: <ProjectName>ApplicationAutoMapperProfile.cs at EasyAbp.AbpHelper.Core.Steps.Common.FileFinderStep.OnExecuteAsync(...)

Relevant code

There is a step that assumes an AutoMapper profile exists and injects mappings into it:

src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/ApplicationAutoMapperProfileStep.cs

This step generates CreateMap code via the template ApplicationAutoMapperProfile_CreateMap and inserts it into a constructor of the profile class.

Expected behavior

For ABP 10+ / Mapperly-based solutions, ABP Helper should not require AutoMapper profile files. Code generation should either:

  • generate/modify Mapperly mappers, or
  • skip AutoMapper-related steps/templates, or
  • make the profile file optional.

Actual behavior

Generation fails unless the file ${ProjectName}ApplicationAutoMapperProfile.cs exists.

Workaround

Create an empty file with the expected name so the workflow doesn’t fail.

Suggested fix

  • Detect ABP version and/or mapping technology (AutoMapper vs Mapperly) and conditionally skip AutoMapper profile workflow steps for Mapperly projects.
  • Provide a Mapperly equivalent step/template for ABP 10+.
  • At minimum, make the AutoMapper profile lookup optional (e.g., ErrorIfNotFound = false) and avoid hard failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions