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#.
Thanks,
John Dolinka. 7 2312
You can mark classes, method properties etc with the Conditional attribute:
[Conditional("DEBUG")]
Or, you can use #define Whatever
HTH,
Bill
"John Dolinka" <jr*********@cdc.gov> wrote in message
news:Oy**************@TK2MSFTNGP11.phx.gbl... 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#. Thanks, John Dolinka.
You can mark classes, method properties etc with the Conditional attribute:
[Conditional("DEBUG")]
Or, you can use #define Whatever
HTH,
Bill
"John Dolinka" <jr*********@cdc.gov> wrote in message
news:Oy**************@TK2MSFTNGP11.phx.gbl... 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#. Thanks, John Dolinka.
Yes, but I have several cs files affected by the conditional compile. I
want to control the conditional compile from a single file. The problem is
the #define directive has to be the first "token" of any cs file, and there
is no provision for grouping defines across a project in a single file (at
least not that I am aware of).
Thanks for your response.
"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message
news:uG**************@tk2msftngp13.phx.gbl... You can mark classes, method properties etc with the Conditional
attribute: [Conditional("DEBUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cdc.gov> wrote in message news:Oy**************@TK2MSFTNGP11.phx.gbl... 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#. Thanks, John Dolinka.
Yes, but I have several cs files affected by the conditional compile. I
want to control the conditional compile from a single file. The problem is
the #define directive has to be the first "token" of any cs file, and there
is no provision for grouping defines across a project in a single file (at
least not that I am aware of).
Thanks for your response.
"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message
news:uG**************@tk2msftngp13.phx.gbl... You can mark classes, method properties etc with the Conditional
attribute: [Conditional("DEBUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cdc.gov> wrote in message news:Oy**************@TK2MSFTNGP11.phx.gbl... 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#. Thanks, John Dolinka.
Right-click on the project and select properties. Select Configuration
Properties and the first property is Conditional Compilation Constants.
This is where you define them in C#.
Pete
-- http://www.petedavis.net
"John Dolinka" <jr*********@cdc.gov> wrote in message
news:eX**************@tk2msftngp13.phx.gbl... Yes, but I have several cs files affected by the conditional compile. I want to control the conditional compile from a single file. The problem
is the #define directive has to be the first "token" of any cs file, and
there is no provision for grouping defines across a project in a single file (at least not that I am aware of). Thanks for your response.
"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message news:uG**************@tk2msftngp13.phx.gbl... You can mark classes, method properties etc with the Conditional attribute: [Conditional("DEBUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cdc.gov> wrote in message news:Oy**************@TK2MSFTNGP11.phx.gbl... 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#. Thanks, John Dolinka.
Right-click on the project and select properties. Select Configuration
Properties and the first property is Conditional Compilation Constants.
This is where you define them in C#.
Pete
-- http://www.petedavis.net
"John Dolinka" <jr*********@cdc.gov> wrote in message
news:eX**************@tk2msftngp13.phx.gbl... Yes, but I have several cs files affected by the conditional compile. I want to control the conditional compile from a single file. The problem
is the #define directive has to be the first "token" of any cs file, and
there is no provision for grouping defines across a project in a single file (at least not that I am aware of). Thanks for your response.
"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message news:uG**************@tk2msftngp13.phx.gbl... You can mark classes, method properties etc with the Conditional attribute: [Conditional("DEBUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cdc.gov> wrote in message news:Oy**************@TK2MSFTNGP11.phx.gbl... 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#. Thanks, John Dolinka.
Thanks! That did the trick.
"Pete Davis" <pd******@hotmail.com> wrote in message
news:03******************************@news.meganet news.com... Right-click on the project and select properties. Select Configuration Properties and the first property is Conditional Compilation Constants.
This is where you define them in C#.
Pete -- http://www.petedavis.net
"John Dolinka" <jr*********@cdc.gov> wrote in message news:eX**************@tk2msftngp13.phx.gbl... Yes, but I have several cs files affected by the conditional compile. I want to control the conditional compile from a single file. The problem is the #define directive has to be the first "token" of any cs file, and there is no provision for grouping defines across a project in a single file
(at least not that I am aware of). Thanks for your response.
"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message news:uG**************@tk2msftngp13.phx.gbl... You can mark classes, method properties etc with the Conditional attribute: [Conditional("DEBUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cdc.gov> wrote in message news:Oy**************@TK2MSFTNGP11.phx.gbl... > 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#. > > > > Thanks, > > > > John Dolinka. > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: Robert W. |
last post by:
I have a library that I'd like to have both a WinForms app and a CF app
utilize. Generally the code is very compatible but sometimes there are some
differences.
At first I thought I could use...
|
by: SStory |
last post by:
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...
|
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...
|
by: Torben Laursen |
last post by:
Hi
Often I just want to compile one c++ file in a project the check it for
errors.
Now I can right click on a *.cpp file and select "Compile"
But is there a way and short cut to compile a file...
|
by: kalaivanan |
last post by:
hi,
how should i compile csharp programs in the cmd command prompt without
being installing visual studio .net. I have installed framework 1.1
and sdk. also i have executed the vsvars32 btach...
|
by: naunetr |
last post by:
hello all,
i wrote the small program below to practice conditional compiling. if i
define MYSYMBOL then everthing works fine, but when i comment MYSYMBOL
gcc gives the following message:...
|
by: Torben Laursen |
last post by:
Hi
Is it possible to write a macro that compiles a file set (cpp/h).
I can find it on the menu if I right click on a cpp file but it would be
nice to just have a
macro that I could call using a...
|
by: pereges |
last post by:
By main file, I mean the one which contains the main routine. Can some
one please provide suggestions as to how I can improve the
organization of main file ? I have just though about a rough...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
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,...
| | |