With Visual Studio versions older than version 2017 you could create two (or more) projects inside your solution. Each one targeting a different framework version.
(Depending on what you're developing it might be best to put your source files inside the project which is set to use the older framework version. But that really depends.)
After that in the second project start adding links to the source files which are physically contained inside your first project. You can do it file by file or select many files and drag with Alt key into the second project. By using links you will still have a single "source of truth" since the source code will be kept in a single physical file only.
Since different framework versions will offer different functionality you might get to a point where you'll have to use conditionals (#if #else ...) inside your source code to get your code compiled for every target framework.
See: C# preprocessor directives
Starting with Visual Studio 2017 you can edit your project files and use the new element "TargetFrameworks". This way you will get around with a single project and from that get several outputs from the build process.
These links might be helpful: