I do not think that's possible. Here are a few alternatives:
- If this is an option at all, it would be much easier to require your users to upgrade to .NET 4.0.
- If you cannot demand updates from your users, you can spend a little more time improving the .NET 3.5 code so that you do not need to create a special version of .NET 4.0.
- ,
#if.