I see this message most times I format my machines after opening existing projects in Visual Studio and I always forgot how I solve it
You may think well that's simple right, install .net 4.7... the only problem then is you get this message which might be why you came to this post
The reason for this is that you need to install the Dev Pack for .net 4.7. In my case I already installed .net 4.7.1 and so just installed 4.7 didn't work for me. https://www.microsoft.com/net/download/windows
Hope this helps someone else and also future me if you reading this you owe me a beer .