Are there any preprocessor symbols which allow something like
#if CLR_AT_LEAST_3.5 // use ReaderWriterLockSlim #else // use ReaderWriterLock #endif
or some other way to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think there are any predefined ‘preprocessor’ symbols. However you can achieve what you want like this:
Create different configurations of your project, one for every version of CLR you want to support.
Choose a symbol like
VERSION2,VERSION3etc. per CLR version.In every configuration, define the one symbol associated with it and undefine all others.
Use these symbols in conditional compilation blocks.