I have this code in my C# class.
#if DEBUG private const string BASE_URL = "http://www.a.com/"; #else private const string BASE_URL = "http://www.b.com//"; #endif
What I wanted to ask is when does the
#if DEBUG
path in the code get executed?
Does it get executed
We use when to mean '(at) the time that'. We use since to refer to a particular time in the past until another time or until now: I had a great time when I went to the coast.
contraction of when is:When's the show over? contraction of when does:When's the next train leave? contraction of when has:When's he ever been an authority?
It was a time when people didn't have to lock their doors. the happy days when we were together We're still waiting for the test results, when we'll decide our next move. Conjunction When he finally showed up, he was drunk. When I was in school, we didn't have computers.
at the same time as. at the time. for the time being. in the course of.
#if DEBUG
It's a preprocessor definition.
It compiles when you define DEBUG constant. And yes, it's default on Debug Build Configuration.
Visual Studio 2010 Project Properties:
If Define DEBUG constant
is checked VS will compile:
private const string BASE_URL = "http://www.a.com/";
Else (not checked) VS will compile:
private const string BASE_URL = "http://www.b.com//";
It's a preprocessor directive. The code in the DEBUG part is compiled when you do a debug build (more specifically when the DEBUG constant is defined). I.e. if you do a debug build BASE_URL will point to www.a.com. Otherwise it will point to www.b.com.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With