how to use #if COMPACT_FRAMEWORK

I am implementing a new security model for a project, and I need to change a dll to be CF compatible (ie remove all XPath stuff).

I figure a good way to do this would be to use, for example:

#if COMPACT_FRAMEWORK
private System.Windows.Forms.Panel gbNewPassword;
#else
private System.Windows.Forms.GroupBox gbNewPassword;
#endif

However, my compiler wont build it, mostly because it doesn't seem to know I want it to build in COMPACT_FRAMEWORK mode. The project is a C# Smart Device project, by the way.

How do I get the compiler to believe we are building the project for compact framework
Should I be creating a new solution configuration

Thanks,

Iceman_Aragorn


Answer this question

how to use #if COMPACT_FRAMEWORK

  • nithinraj

    You'd need to define COMPACT_FRAMEWORK macro in project's properties. It’s in a Build tab in “Conditional compilation symbols”.



  • R.Tutus

    thanks, this was very helpful.
  • how to use #if COMPACT_FRAMEWORK