.NET 2005 Pre-processing directives

G

Guest

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
 
N

Nicholas Paldino [.NET/C# MVP]

Avin,

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

Hope this helps.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top