473,569 Members | 2,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

debug switch in visual studio - easy question

Dan
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
Nov 19 '05 #1
2 1375
protected void Page_Load(objec t 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


Nov 19 '05 #2
On Fri, 18 Mar 2005 11:37:08 -0600, Brock Allen
<ba****@develop .com.i_hate_spa m_too> wrote:
protected void Page_Load(objec t 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
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2842
by: John Smith | last post by:
Sorry if this is the wrong forum... Does anyone know what the difference is between a debug build and an optimised debug build in Visual Studio 2003?
2
2060
by: NAGY | last post by:
hello, I created an asp.net web app in C# from a non administrative account in Visual Studio 2003, .net 1.1. when i try to run the application in debug mode from Debug start menu option, i get an error saying "Error while trying to run project : unable to start debugging on web server. Access is Denied". i searched for the solution on various...
8
1910
by: | last post by:
I'm starting up the development server myself and using the "Startup Url" property of the web project. The problem is i cannot debug. The debug symbols are never loaded. I realize they are under the temporary internet files folder but I have even tried using the new depoloyment addin-in but that does not seem to work either. There is a /bin...
6
2568
by: tascien | last post by:
Hi guys, here is a puzzling question... I am able to debug my project on my dev server very fine. Now, here is a question: - I set the project to release. I copy the project to the production server. - the project has a problem on the production server. - How do i debug it? Should I install visual studio on the production server? how do...
4
6237
by: nmrcarl | last post by:
I'm trying to upgrade a large project from VS 6.0 to VS 2005. After fixing a lot of things that changed (mostly sloppy coding in the original project that VS2005 didn't allow), I got the release version to build successfully. Unfortunately, it crashes right away when I start it. So now I need to build the debug version. Unfortunately, the...
6
9126
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++ project. I then add a class library, and add a reference to this project in the first project. When I do a release build, I see the following in the...
0
1727
by: =?Utf-8?B?SmVmLnB0Yw==?= | last post by:
Hi, I am currently facing exactly the same issue with Visual Studio 2005. Did you find a way to solve this problem ? "AntonioSACE" wrote:
2
4084
by: =?Utf-8?B?V2lsbGlhbSBNY0lscm95?= | last post by:
Here's the problem. I've been developing a C++ application since 2003 using the default settings. Comes time to find all the memory leaks. I downloaded a nifty package that won't work unless I use the debug library DLLs. I get nothing but complaints from Visual Studio 2008. On <name-of-appProperty Page I change Use of MFC to Shared DLL. ...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.