Rockford Lhotka wrote about an obscure feature in .Net where u can implement a sort of conditional compilation by using attributes. It could be useful in some cases but he points out that its there might be cases where it can lead to all kinds of confusion.
Basically u use the attribute '[Conditional()] e.g.
[Conditional(“MyFlag“) ]
public void Foo()
{
//stuff here
}
If u compile the code with the above mention method it will (as Rocky puts it) magically dissapear from the IL generated. To have it compiled u need to add the following:
#Const MyFlag = True
Now the method will be compiled into the final IL.
Interesting hey?
Read more here