473,765 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
+ 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 6034
"SStory" <Th*******@TAKE THISSPAMBUSTERO UT.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 " -> "Configurat ion 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.ac tivevb.de> wrote in message
news:eA******** ******@TK2MSFTN GP09.phx.gbl...
"SStory" <Th*******@TAKE THISSPAMBUSTERO UT.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 " -> "Configurat ion 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*******@TAKE THISSPAMBUSTERO UT.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
1768
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 i.e. only if the bit in the register is set I want to go ahead & compile the piece of code else it is left untouched. Basically, this has to happen at the pre-processor stage.
3
5935
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 terminated by pressing ++ and then terminate the process. I searched the entire internet and found out that there could be two things wrong (both of them are mentioned in the bug list on the access
1
16559
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
2336
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 #defines using an "include like" directive. C# does not have a #include directive so it appears that I can not do this. Am I missing something? Is it possible to do this in c#.
2
4383
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)? Deactivate() : Activate(); } the compiler gives the following error...
6
1568
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
8000
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 #IF CONFIG = "BestRelease", compiler doesn't recognize the true condition and doesn't compile statements inside #IF... #END IF block. Is this a bug? Any other way to have conditional compile in a project, using only a single variable (I need...
7
13809
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 difference between them is a reference to a different assembly. Is it possible to do this in VS2005?
2
2351
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 on. I have a second table that contains a list of tasks to be performed and relates to the Case_List through a Case_ID. So currently, I can bring up a form that has a list of all my cases, I can then select a case and it opens a new form that...
0
10160
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8831
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
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 we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.