Open Closed

Failure to maintain changes to extended.razor.cs #8910


User avatar
0
oduran created
  • ABP Framework version: v9.0.2
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hello.

I referenced the link https://abp.io/docs/commercial/latest/abp-suite/customizing-the-generated-code and made a few attempts. But I am having the problem I explain below.

I defined an entity named “CacheMessages”. When I add a new column to this entity (when migration happens in ABP Suite), the codes I wrote in the 'MyProject.Blazor/Pages/CacheMessages.Extended.razor.cs' file are automatically deleted.

Before save and generate: public partial class CacheMessages { my custom codes... }

After save and generate (in ABP Suite): public partial class CacheMessages {

}

At the same time, I may need to customize the methods in MyProject.Blazor/Pages/CacheMessages.razor.cs created by ABP by default (for example, adding a new button inside the SetToolbarItemsAsync method, etc.). How should I use MyProject.Blazor/Pages/CacheMessages.extended.razor.cs to prevent this? Can you help me with this issue?


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

    Hi, there was a problem with the custom code support in the prior versions, and it was fixed with v9.0.5+. So, if you update ABP Suite to v9.0.5, then you should be able to re-generate without losing your custom code changes.

    Best regards.

  • User Avatar
    0
    oduran created

    Dear Engincan

    I upgraded ABP suite version to v9.1.0. The same problems still exist.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Dear Engincan

    I upgraded ABP suite version to v9.1.0. The same problems still exist.

    Hi, you mean it still regenerates the .extended.cs file each time? I will check this.

  • User Avatar
    0
    oduran created

    Thank you for your support. If there is anything I can help you with, just let me know.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Thank you for your support. If there is anything I can help you with, just let me know.

    Hi, thanks for your understanding. I have tested just before and indeed the problem is not fixed for the .extended.razor.cs files (but it works for .extended.cs files). I will create an internal issue for that, thanks for reporting.

    Btw, your ticket is refunded. Best regards.

  • User Avatar
    0
    oduran created

    Hi,

    Thank you for refunding my ticket.

    How can I be notified when the problem is solved?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi,

    Thank you for refunding my ticket.

    How can I be notified when the problem is solved?

    I have opened a PR for this problem and it will be included in the next patch release. So, when v9.1.1 is released, you can try it out.

  • User Avatar
    0
    oduran created

    Thank you for your supports. Regards.

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.0.0-preview. Updated on July 17, 2025, 06:22