Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>Is the fact that that's there defeating the purpose of removing it from <code>&lt;compilation&gt;</code></p> </blockquote> <p>From <a href="http://msdn.microsoft.com/en-us/library/6s2x2bzy.aspx" rel="nofollow">MSDN C# Compiler Options</a><br> To open the <strong>debug</strong> the flag on the compiler is the <code>/debug</code> not the <code>/define:Debug=True</code></p> <blockquote> <p>/debug : <strong>Instruct the compiler to emit debugging information.</strong><br> /define : <strong>Defines preprocessor symbols.</strong></p> </blockquote> <p>So when you define the <code>Debug=True</code> you only make true this case of code:</p> <pre><code>#if DEBUG == true // Compile what is inside here ! #endif </code></pre> <p>the <code>/define:Debug=True</code> is not add any additional debug informations, unless you have include them manual with the above code.</p> <h2>Test page</h2> <p>I use the following code to make tests and see whats happens.</p> <pre><code> txtDebug.Text = HttpContext.Current.IsDebuggingEnabled.ToString(); #if DEBUG txtDebug.Text += "&lt;br&gt;defined Debug is on"; #endif #if DEBUG == true txtDebug.Text += "&lt;br&gt;defined Debug = true is on"; #endif </code></pre> <h2>Result 1</h2> <p>Now if the <code>debug="false"</code> and with <code>compilerOptions="/define:Debug=True"</code> the results are</p> <blockquote> <p>false<br> defined Debug = true is on</p> </blockquote> <h2>Result 2</h2> <p>if the <code>debug="true"</code> and <code>compilerOptions="/define:Debug=True"</code> the resuls are</p> <blockquote> <p>true<br> defined Debug is on<br> defined Debug = true is on</p> </blockquote> <h2>Result 3</h2> <p>Now I make one more test, I add this line on web.config</p> <pre><code> &lt;compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/define:Debug=True /D:DEBUG,TESTFLAG" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4" /&gt; </code></pre> <p>And the results are with <code>debug=false</code></p> <blockquote> <p>False (debug is false)<br> defined Debug is on (but the defined DEBUG now is runs)<br> defined Debug = true is on (This is also runs)<br> test flag (but the defined extra flag is also runs) </p> </blockquote> <h2>MSDN</h2> <p>Looking at the <a href="http://msdn.microsoft.com/en-us/library/0feaad6z(v=vs.71).aspx" rel="nofollow">MSDN for the /define (Preprocessor Definition)</a> I look that the declaration </p> <pre><code>/define:Debug=True </code></pre> <p>is work only for this case of code</p> <pre><code>#if DEBUG == true txtDebug.Text += "&lt;br&gt;defined Debug = true is on"; #endif </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload