Add custom vcproj to solution

I’ve started a new project, and I’ve to add custom libraries to it. I’ve seen in this page

Integrating Third-Party Libraries into Unreal Engine | Unreal Engine 5.0 Documentation

that I can link directly to an external dll. The problem is that I don’t want an external library: I’ve the source code and I need to create a project in UE5 solution and work with it. If I do it manually, it doesn’t work, because every time that I regenerate the solution the configuration is lost.

How can I add permanently a custom vcproj into the UE5 solution?