Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > debug switch in visual studio - easy question

Reply
Thread Tools

debug switch in visual studio - easy question

 
 
Dan
Guest
Posts: n/a
 
      03-18-2005
Hi
I need to execute a line of code when debugging and another when in release
without having to manually comment and uncomment. Can anyone tell me the
switch syntax in c# in visual studio? thanls


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      03-18-2005
protected void Page_Load(object sender, EventArgs e)
{
#if DEBUG
Response.Write("DEBUG");
#endif
}


-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hi
> I need to execute a line of code when debugging and another when in
> release
> without having to manually comment and uncomment. Can anyone tell me
> the
> switch syntax in c# in visual studio? thanls




 
Reply With Quote
 
 
 
 
Craig Deelsnyder
Guest
Posts: n/a
 
      03-18-2005
On Fri, 18 Mar 2005 11:37:08 -0600, Brock Allen
<(E-Mail Removed)_hate_spam_too> wrote:

> protected void Page_Load(object sender, EventArgs e)
> {
> #if DEBUG
> Response.Write("DEBUG");
> #endif
> }
>
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> Hi
>> I need to execute a line of code when debugging and another when in
>> release
>> without having to manually comment and uncomment. Can anyone tell me
>> the
>> switch syntax in c# in visual studio? thanls

>
>
>


and a full reference is on MSDN:
http://msdn.microsoft.com/library/de...rpspec_2_5.asp

note there is an #else as well

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Visual Studio 2005 complict with Visual Studio 2003 rockdale ASP .Net 1 08-23-2006 07:20 PM
Should I write Visual studio 2005 or Visual studio 2003 MCSD =?Utf-8?B?VmlqYXk=?= Microsoft Certification 14 06-30-2006 09:05 AM
Is Visual Studio Team System and Visual Studio Foundation Server are same?. Thirumalai ASP .Net 0 05-22-2006 08:48 AM
visual studio .net 2003 verses visual studio .net 2002 wh ASP .Net 2 01-16-2004 04:54 PM



Advertisments