By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,462 Members | 1,478 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,462 IT Pros & Developers. It's quick & easy.

predefined preprocessor constants

P: n/a
Does C# have any predefined preprocessor constants like the C/C++
compiler does? In C++ you had such predefined constants as:
__cplusplus, _DEBUG, _WIN32, MSC_VER.

Are there any such things for C#? It would be nice if there were some
for .Net version (1 or 2), compact framework or full framework, etc.

Thanks.

Randy Beckwith

Jan 27 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
There are no predefined preprocessor directives in C#. You define your own,
either on the command line to the compiler, or in Visual Studio (or
web.config if it is an ASP.NET app). The Visual Studio Project setup
automatically inserts the "DEBUG" directive.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"me******@yahoo.com" wrote:
Does C# have any predefined preprocessor constants like the C/C++
compiler does? In C++ you had such predefined constants as:
__cplusplus, _DEBUG, _WIN32, MSC_VER.

Are there any such things for C#? It would be nice if there were some
for .Net version (1 or 2), compact framework or full framework, etc.

Thanks.

Randy Beckwith

Jan 27 '07 #2

P: n/a
They always take out the useful things... Thanks, Peter.

Randy
On Jan 27, 4:40 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
There are no predefined preprocessor directives in C#. You define your own,
either on the command line to the compiler, or in Visual Studio (or
web.config if it is an ASP.NET app). The Visual Studio Project setup
automatically inserts the "DEBUG" directive.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net

"merku...@yahoo.com" wrote:
Does C# have any predefined preprocessor constants like the C/C++
compiler does? In C++ you had such predefined constants as:
__cplusplus, _DEBUG, _WIN32, MSC_VER.
Are there any such things for C#? It would be nice if there were some
for .Net version (1 or 2), compact framework or full framework, etc.
Thanks.
Randy Beckwith
Jan 28 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.