Open Closed

ABP Suite generates broken code. #572


User avatar
1
GregB created

Suite is generating invalid C#. It's looks like it's leaving a replacement token on the end of property definitions.

I'm using Suite 3.3.1

[StringLength(BomListConsts.DescriptionMaxLength)]
public string Description { get; set; } %%initial-value%%

I've tried creating a brand new Suite project and adding a simple Foo entity with a sinle int property and I get the following code for the DTOs.

public class FoooCreateDto
    {
        public int? F1 { get; set; } %%initial-value%%
    }
    
    
    public class FoooDto : FullAuditedEntityDto<Guid>
    {
        public int? F1 { get; set; } %%initial-value%%
    }
    
    
    public class FoooUpdateDto
    {
        public int? F1 { get; set; } %%initial-value%%
    }

The tool is absolutely unusable and I've wasted half a day trying different things to get it working thinking it was something wrong with my object definition.

This is unacceptable.

Please advise


7 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I can't reproduce your problem, Is your solution consistent with the suite version? Can you provide steps to reproduce? thanks.

  • User Avatar
    0
    alper created
    Support Team Director

    Make sure both your Suite and your ABP versions are the same. As I see this looks like you are using the latest version of Suite.

  • User Avatar
    1
    rcalv002 created

    Fresh install of the abp cli and suite, generate solution from suite, open solution in vs2019 run db migrator project to create the db, add any entity with any props, the steps suceed from 1-8, step 9 the db migrator part fails as most of the related .cs documents end up placing %%initial-value%% next to the generated properties..

  • User Avatar
    1
    rcalv002 created

    Initial-value problem seems to have dissapeared after i updated efcore tools from prev version 3.1.4 then it would still fail to generate the migration on the last step (angular project would get the info, classes also created in dotnetcore). It seems that if i manually add a migration (1 time) to the new project and apply it, i can then add entities from abp suite and it succeeds. Strange?

  • User Avatar
    0
    alper created
    Support Team Director

    can you send us the project? info@abp.io

  • User Avatar
    0
    rcalv002 created

    Hi Alper, I was replicating this in a new project for you but seems this new 3.3.2 fixed the issue

  • User Avatar
    0
    alper created
    Support Team Director

    good! so update it to 3.3.2 I'm closing the issue. reopen if it continues... happy coding.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15