conditional compilation by framework version

  • Thread starter Thread starter Petr Majer
  • Start date Start date
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
 
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.
 
Back
Top