 Did you know that in Csharp, we can conditionally compile and execute methods depending on the compilation symbol? Hello there, this is Krish Raj and in this video we will be going to learn that how we can conditionally execute any code or method depending on the predefined compilation symbol. So here in this demo console application, first I have initialized an instance of this log API class and in this class this is just one simple method which will write this message in the console and after that I have defined this pre-processor if directive and when the Csharp compiler encounter this pre-processor if directive followed by an end if directive it compiles the code between the directives only if the specified symbol is defined. So right now for this application, I have not defined any symbol. So when I run this application, this line should not be hit. So for confirmation, let me add the breakpoint over here. Now when I run this application, this line is not executed. Now when I click on continue button, there is no any message printed over here. Now let us define this compilation symbol for this application. So to define the compilation symbol, you need to go fast into the application property and then in this build section, you need to define the compilation symbol in this tax box. In our case, it's sandbox. Let me save this application and now when I run this application, our breakpoint is hit and you can see this message in this console application. Okay. So now so far so good. So now let's say if I have lots of this type of method and I want to wrap this method in this type of pre-processor if directive, it can start to get a bit of messy. Also if I ever wanted to change the name of this symbol, for example from sandbox to say dev environment, then I need to change it in multiple places. So there is an alternative to using the conditional compilation directive. So let's look at that.