conditional compilation by framework version

P

Petr Majer

I want to develop project (Visual Basic), which will be
compilable in wisual studio 2002 and also in visual studio
2003.

Unfortunatelly, there are some classes and functions in
framework 1.1, (which I must to use), and which are not
supported in framework 1.0.

How can I write following?

#if ("Version of framework" = 1.1) then
'code for visual studio 2003
#else
'code for visual studio 2003
#end if

My question:
What is the right name of the constant "Version of
framework", useable in directive #if ?

thanks
 
T

Tian Min Huang

Hi,

Based on my experience and research, I believe there are no predefined
constants for the "Version of framework".

As you know, Visual Basic .NET support conditional compilation with
#If...Then...#Else directive. We can set conditional compilation constants
in one of three ways:

1. In the Property Pages dialog box
2. At the command line when using the command-line compiler
3. In your code

Please refer to the following MSDN documentation:

Declaring Conditional Compilation Constants
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/
vacondeclaringconditionalcompilationconstants.asp

Conditional Compilation
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/
vaconConditionalCompilationPortal.asp?frame=true

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
 

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