Thanks for the information John.
I'm using MSBuild so it took a bit to figure out how to pass this stuff in from the command line. In case anyone else has occassion to use it I thought I'd share how I did it.
Inside my compile target I set a <csc> block with the DefineConstants property being used like /d: using csc from the command line to set the confitional compilation symbol:
Then, in the area where I set my other properties I have a DefineConstants node that will pass in the right setting based on what framework version I'm trying to compile against.
<When Condition=" '$(TargetFrameworkVersion)'=='1.1' ">
<When Condition=" '$(TargetFrameworkVersion)'=='2.0' ">
In Visual Studio it's almost exactly like it is in your IDE. You just go to Project/Properties and then the Build tab and add in what you need in to the Conditional Compilation Symbols field.
As an aside, I didn't see how to switch to target another .NET framework to compile against in VS. Very easy in SharpDevelop.
How you set this depends on your environment.
From the command line with csc you can use /d:NET_VER_1
In #Develop 2.1 Open Project\Project Options and in the compiling tab at the top you can enter conditional compilation symbols. It is likely to be done similarly in other IDE environments.