I have following program:
public class TestClass
{
[Conditional("DEBUG")]
static void debug_foo()
{
Console.WriteLine("DEBUG foo");
}
static int Main(System.String[] args)
{
debug_foo();
return 0;
}
}
I compiled program using Release mode. I found il code of debug_foo method in assembly. I cannot understand reason of such solution. I thought that if c# compiler can understand, that method is not used, then compiler need not to generate il code at all (for example, it will not generate call instruction in main function), beacuse it slows compilation and increase size of assembly.