What is the .NET attribuet to not compile a method is release mode
Posted
by Russ
on Stack Overflow
See other posts from Stack Overflow
or by Russ
Published on 2010-05-10T14:18:21Z
Indexed on
2010/05/10
14:24 UTC
Read the original article
Hit count: 235
I know that if I have a block of code I don't want compiled when in release mode I can wrap that code block in:
#if DEBUG
while(true)
{ Console.WriteLine("StackOverflow rules"); }
#endif
This will keep this code block from compiling in any mode other than DEBUG
.
I know there is an attribute that can be placed on an entire method that will do that same, but for the life of me I can't remember what that attribute is. I believe that it’s down the System.Diagnostics
namespace, but I'm not really sure.
BTW: I'm using .NET 4, but I know this attribute existed in .NET 2 because I have used in in old projects.
Thanks
© Stack Overflow or respective owner