471,570 Members | 902 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

.NET 2005 Pre-processing directives

Hi,
Does 2005 has inbuild pre-precessing directive, So I don't have to define
mine. Basically I can use it to find out code is getting compiled with 2005
or 2003 compiler.

Basically I my code, there is some line like:
#if NET2005
allAddrs =System.Net.Dns.GetHostEntry(
System.Net.Dns.GetHostName()).AddressList;
#else
allAddrs =System.Net.Dns.GetHostByName(
System.Net.Dns.GetHostName()).AddressList;
#endif

Than I have to pass the NET2005 directive if I am compiling with 2005 csc
compiler. Instead of that is there any inbuilt directive exist?

Thank you for your time.
Avin Patel
Dec 1 '05 #1
2 1728
Avin,

No, there is not. You will have to define this yourself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Avin Patel" <Av*******@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
Hi,
Does 2005 has inbuild pre-precessing directive, So I don't have to define
mine. Basically I can use it to find out code is getting compiled with
2005
or 2003 compiler.

Basically I my code, there is some line like:
#if NET2005
allAddrs =System.Net.Dns.GetHostEntry(
System.Net.Dns.GetHostName()).AddressList;
#else
allAddrs =System.Net.Dns.GetHostByName(
System.Net.Dns.GetHostName()).AddressList;
#endif

Than I have to pass the NET2005 directive if I am compiling with 2005 csc
compiler. Instead of that is there any inbuilt directive exist?

Thank you for your time.
Avin Patel

Dec 1 '05 #2
Avin,

NET2005? You probably mean VS2005 or NET2 or maybe NET20 :)
Nervermind... I'm just kidding :)

No, VS doesn't define such directives; it only defines (at least for C# and
VB projects) DEBUG and TRACE. However you don't need to define them in the
code for each file, you do that in the project's settings. If you do that
make sure you define them for all configurations.
--

Stoitcho Goutsev (100) [C# MVP]

"Avin Patel" <Av*******@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
Hi,
Does 2005 has inbuild pre-precessing directive, So I don't have to define
mine. Basically I can use it to find out code is getting compiled with
2005
or 2003 compiler.

Basically I my code, there is some line like:
#if NET2005
allAddrs =System.Net.Dns.GetHostEntry(
System.Net.Dns.GetHostName()).AddressList;
#else
allAddrs =System.Net.Dns.GetHostByName(
System.Net.Dns.GetHostName()).AddressList;
#endif

Than I have to pass the NET2005 directive if I am compiling with 2005 csc
compiler. Instead of that is there any inbuilt directive exist?

Thank you for your time.
Avin Patel

Dec 1 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by melledge | last post: by
reply views Thread by Marcel - IDUG Europe 2005 | last post: by
8 posts views Thread by Mike Owen | last post: by
16 posts views Thread by Kent | last post: by
1 post views Thread by Arthur Dent | last post: by
27 posts views Thread by Rene | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

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.