.NET Framework 2.x is installed with .NET Framework 3.5.
Under Windows 10, this is available on the installation media, e.g. USB installer.
If that is what you have, you can open an administrative PowerShell prompt, and enter
DISM /Online /Enable-Feature /FeatureName:NETFX3 /Source:C:\sources\sxs /LimitAccess
replacing X by the drive letter for the installation media.
If you have a different OS, or no installation media, a different approach will be needed, but the same thing applies: install Framework version 3.5.