Is it possible, and if yes then how can I do it, to create a .NET project (in C#) which can be compiled both for 2.0 and 4.0 .NET.
What I need:
I'd like to create a project with some features available in C# 4.0, but using these features is optional. If the project is compiled for .NET 4.0, the features are active and compiled in. When compiling for 2.0 the features are turned out and omitted.
I'd like to have one building process, which means when I click the "build" button in VS the project is built for both 2.0 and 4.0 creating separated assemblies and executables.
How can I configure my project and my code to achieve this requirement?