Почему #IF Not DEBUG
работает так, как я ожидал бы в VB.NET?
#If DEBUG Then
Console.WriteLine("Debug")
#End If
#If Not DEBUG Then
Console.WriteLine("Not Debug")
#End If
#If DEBUG = False Then
Console.WriteLine("Not Debug")
#End If
' Outputs: Debug, Not Debug
Но, заданная вручную команда const:
#Const D = True
#If D Then
Console.WriteLine("D")
#End If
#If Not D Then
Console.WriteLine("Not D")
#End If
' Outputs: D
И, конечно же, С# также имеет ожидаемое поведение:
#if DEBUG
Console.WriteLine("Debug");
#endif
#if !DEBUG
Console.WriteLine("Not Debug");
#endif
// Outputs: Debug