473,473 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Conditional compile based upon Active Configuration

I would like to have some code compile if my Active Configuration is set to
debug and not compile if it is set to Release.

I don't want to have to remember to define a constant. I just want to
change configurations and all debug code not execute.

How is this possible.

Thanks in advance,

Shane
Nov 20 '05 #1
3 6017
"SStory" <Th*******@TAKETHISSPAMBUSTEROUT.Softhome.net> schrieb:
I would like to have some code compile if my Active
Configuration is set to debug and not compile if it
is set to Release.

I don't want to have to remember to define a constant.
I just want to change configurations and all debug code
not execute.


\\\
#If Debug Then
...
#End If
///

Select the project in the project explorer, select the "Project" menu ->
"Properties" -> "Configuration Settings" -> "Build" -> "Define DEBUG
constant" (translated from the German language version of VS.NET 2002).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
cool , I found it.
Thre is a checkbox that says Defin Debug Constant already checked in the
debug configuration.
That is what I wanted to do.

I can't always remember to define one. This will be helpful. Keep me from
burning a CD with Debug code still in.

Danke Herr Wagner, Guten Aben (I think good evening... not sure.... I
remember, Guten Morgan,Guten tag, Guten Aben...)

Shane
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:eA**************@TK2MSFTNGP09.phx.gbl...
"SStory" <Th*******@TAKETHISSPAMBUSTEROUT.Softhome.net> schrieb:
I would like to have some code compile if my Active
Configuration is set to debug and not compile if it
is set to Release.

I don't want to have to remember to define a constant.
I just want to change configurations and all debug code
not execute.


\\\
#If Debug Then
...
#End If
///

Select the project in the project explorer, select the "Project" menu ->
"Properties" -> "Configuration Settings" -> "Build" -> "Define DEBUG
constant" (translated from the German language version of VS.NET 2002).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
"SStory" <Th*******@TAKETHISSPAMBUSTEROUT.Softhome.net> schrieb:
Danke Herr Wagner, Guten Aben (I think good evening... not sure.... I
remember, Guten Morgan,Guten tag, Guten Aben...)


"Guten Abend", "Guten Tag", "Guten Morgen"

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4

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

Similar topics

5
by: ashok.anbalan | last post by:
Hi, I am working with a VC++ based tool that does hardware reads & writes besides some other stuff. I want to conditionally compile a piece of code based on the value of a field in a register...
3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
1
by: chris han | last post by:
Hi, all, I'm trying to use Conditional Compilation Statements in my code. using System; #define DEBUG public class MyClass { public static void Main() {
7
by: John Dolinka | last post by:
I have a project of several files with #defines to setup a conditional compile. I would like to put these #defines in a single file and change the conditional compile from this one file with the...
2
by: Rob Williams | last post by:
The following code will not compile... public bool active = false; public void Activate(){} public void Deactivate(){} public void object_Activate(object sender, EventArgs e){ (active)?...
6
by: Marc Jennings | last post by:
Hi there, I am trying to get some conditional functionality into some of my apps. I can use the format : private void doStuff() { //do something }
5
by: Trapulo | last post by:
I'm using conditonal compile with statement #IF CONFIG This works if I use #IF CONFIG = "Debug" or #IF CONFIG= "Release" But if I define an other compilation profile, eg. "BestRelease", and I use...
7
by: Oldman | last post by:
How do you conditionally reference an assembly based off of the build configuration? Imagine a scenario where I want to have an Sql Release Server build and an Oracle Release Build and the only...
2
by: jodyblau | last post by:
I'm not certain that what I am trying to do is possible; in any event I haven't been able to figure it out. Here is what I am trying to do: I have one table that has a list of cases I'm working...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
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.