.NET 2005 Pre-processing directives

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Avin,

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

Hope this helps.
 
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.
 
Back
Top