473,395 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 1759
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dr. International | last post by:
Are you in charge of making your company's application ready to ship to China, India and Russia? If you are attending Tech·Ed 2005 in Orlando this July and own this responsibility, the...
0
by: melledge | last post by:
The Reliable Source for Everything XML - XML 2005 Update XML 2005 - November 14-18 - Atlanta Hilton Hotel - Atlanta, GA www.xmlconference.org Register today and participate in IDEAlliance's...
0
by: Marcel - IDUG Europe 2005 | last post by:
Dear DB2 user, My name is Marcel Lévy and I'm a member of the IDUG 2005 Europe Conference Planning Committee. ********************************************************************* Mark your...
8
by: Mike Owen | last post by:
Hi, I am trying to pre-compile a project prior using ASP.Net 2.0, VS 2005, to putting it onto a live server. The reason for doing this is that other people have access to the server, and I...
16
by: Kent | last post by:
We have created several Assemblies that we add to the GAC on our web servers. In an ASP.NET app in VS2003, Adding a reference to strong named GAC'd Assembly meant that the web app would use...
1
by: Arthur Dent | last post by:
Hello all, ... question for those who've been playing with the 2005 pre-releases: Does VB.NET have pre & post-build events in 2005 by any chance? This would be such a a great improvement. ...
27
by: Rene | last post by:
I keep getting the following error every time I compile the solution under VS 2005: ---------------- Error 5 Unable to copy file "obj\Debug\xyz.dll" to "bin\Debug\xyz.dll". The process...
5
by: rmgalante | last post by:
I've been using the VS2005 Publish utility on one of my projects for about six months. I have a large site with hundreds of files, thousands if you include the code behind files. So I thought...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
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 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.