Is there a compilation symbol to detect if it’s running on a compact framework platform
Share
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.
You have a discontinuity in your question. You’re asking about a compile symbol, so something that exists only at design time, and detecting a condition while running. So the question for you is which one are you actually after?
If you want to know at run time if you’re under the CF, then check the Environment.OSVersion.Platform property to see if it’s WinCE.
At compile time it’s not quite as straightforward. The default project Wizards add the compilation Symbols “PocketPC” for PPC/WinMo projects, “WindowsCE” for WinCE projects and “WINDOWS_PHONE” for Phone7 projects so you can do something like this:
But there’s nothing to say that a developer can’t delete that symbol (or add it on a desktop project).