Custom Activities with code, how to setup? (For Legacy)

Ahhh yes sorry, for the window legacy projects you need that version of the documentation. Did you follow the guide step-by-step? It references .NET 4.6.1 there, selecting it as a framework and adding it as a reference.

Btw, you are aware that legacy is being deprecated by UiPath? You will still be able to edit existing legacy project for a while, but it is already recommended to start migrating.