Re: VS2005 conditional directive



Hi Kevin,
I finally have the chance to try today. I have a web page with following
code:

protected void Page_Load(object sender, System.EventArgs e) {
#if DEBUG
Response.Write("Debug");
#else
Response.Write("Release");
#endif
}

I switched project to release mode, and compiled with web deployment
project, and copied all files to server. I opened web.config of this project
on server, and noticed :

<compilation debug="false" defaultLanguage="c#">

When I run the project, I still see "Debug" displayed.

--
WWW: http://www.imagestation.com/members/hardywang
ICQ: 3359839
yours Hardy
"Kevin Yu [MSFT]" <v-kevy@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:FlkwCnX0GHA.4280@xxxxxxxxxxxxxxxxxxxxxxxx
Hi Hardy,

Based on my research, VS2005 still supports the conditional directive. You
can switch the DEBUG and RELEASE mode in web.config file. An element named
<compilation debug="false"/>. If you use true, it is debug mode, while if
you use false, it's release mode.

When I tried it on my machine, it works fine.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



.



Relevant Pages

  • Re: attach to process not started in debug mode?
    ... Jeffrey - I've got a box at a remote ISP where I may need to debug the app from ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)
  • RE: Debugging design time behavior od user controls.
    ... However, to debug a UserControl at design-time, we need to do more work. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Step by Step skips large chunks of code
    ... The interesting thing is that it still skips code during debug but not ... has been correctly complied into assembly code. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.debugging)
  • cpufreq oddness on 2.6.16-rc1-mm4
    ... Some debug info, dmesg, and config are below. ... # Console display driver support ... # USB Device Class drivers ...
    (Linux-Kernel)
  • Re: winword.exe.manifest for multiple add-ins?
    ... Microsoft Online Community Support ... Get notification to my posts through email? ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.office.developer.com.add_ins)