Couple of things:
Don't use #define in C# - it doesn't work like it does in C or C++. #define values can only be used in #if and suchlike, not to affect "normal" code
You are deriving
MyClass
from the abstract class
Attribute
- but you aren't implementing any of the required methods.
Since you are a beginner, just remove the derivation:
public class MyClass
{
[Conditional("DEBUG")]
public static void Message(string msg)
{
Console.WriteLine(msg);
}
}
And ensure you are compiling the debug version of your code.
"Learning it myself" is not a good solution: get a book, or better go on a course - and follow it from the beginning to the end. Just trying to learn it as you go along is a good way to confuse yourself, as I think you have here. C# shares a lot of similar syntax with C and C++, but it is a very different language under the hood, and you shouldn't try to use C or C++ methodology and thinking or it will get very confusing!