- Home /
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?
I tried with the API .NET 2.0 ins$$anonymous$$d of the subset and it works. Sorry for the spelling error, I didn't copy paste the code :P
Can you convert your comment to an answer or something so I can mark it as the solution?
Thanks Wolfram!
Answer by Wolfram · Jan 23, 2013 at 08:36 PM
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)
Answer by iwaldrop · Jan 23, 2013 at 08:28 PM
That's new to me!
I haven't gone through and checked it all out, but perhaps this will help?
http://msdn.microsoft.com/en-us/library/4xssyw96(v=vs.71).aspx
http://answers.unity3d.com/questions/9983/how-can-i-use-cs-conditional-attribute-in-unity-ip.html
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Distribute terrain in zones 3 Answers
Unity 3d(Space) Questions 1 Answer
Turning Spinners Based on an Integer 0 Answers