How can i use C#'s Conditional Compilation

I’m trying to use the conditional compilation for C# with the Syntax : [Conditional(“DEBUG”)]

Example :

[Condtional("DEBUG")]
public type functionName
{
      //Code
}

However Monodevelop returns me an error saying Conditional cannot be found. I did include System.Diagnostic…

I could use the #if DEBUG #endIf but it doesn’t do the exact same thing in this case.

Did anyone used the conditional thing before?

That’s new to me!

I haven’t gone through and checked it all out, but perhaps this will help?

Some wild guessing:

  • enable “.NET 2.0” instead of “.NET 2.0 subset” in the project settings.
  • check your spelling - the code you posted is missing an “i” (I realize it’s just an example)