This is a question out of curiousity. I was messing around with some code, and realized that the following still compiles in release:
class Program
{
[Conditional("DEBUG")]
private static void Main()
{
// do stuff
}
}
I thought ConditionalAttribute was supposed to wipe out the method, but it doesn't. What's special about the entry point?
I believe it wipes out the calls to the method, not the method itself. Main
is never (or should never be) called from your code, so this won't change anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With