I need to compile code conditionally by the CLR version.
e.g there's a code that I need to compile only in CLR 2 (.NET 3.5 VS2008) and not in CLR 4 (.NET 4 VS2010)
Is there a precompiler directive for the current CLR version that I can use inside an #if clause?
Thanks.
Not as I know.
try use your own one, such like:
And then you can define CLR_V2 and/or CLR_V4 in project properties window of Visual Studio, or csc command line arguments.