Multi-version compilation [modified]
-
Hi, as all we know there are at least 4 different versions of .NET framework. is there any internal IDE constant, that defines wich version of the framework is expected the IDE to build for? Motivation: It's very common having various versions of the framework living in the same machine. The IDE seems to build compatible binaries with the newest framework installed on system, thus coppying the sources on another machine, makes impossible to compile the code, without, changing lots of lines of code.. COMMON valid compatible CODE #if NETFW_VERSION_1_1 1 valid code for 1.1 #else #if NETFW_VERSION 2_0 valid code for 2.0 #endif COMMON valid compatible CODE -- modified at 11:43 Monday 5th March, 2007
-
Hi, as all we know there are at least 4 different versions of .NET framework. is there any internal IDE constant, that defines wich version of the framework is expected the IDE to build for? Motivation: It's very common having various versions of the framework living in the same machine. The IDE seems to build compatible binaries with the newest framework installed on system, thus coppying the sources on another machine, makes impossible to compile the code, without, changing lots of lines of code.. COMMON valid compatible CODE #if NETFW_VERSION_1_1 1 valid code for 1.1 #else #if NETFW_VERSION 2_0 valid code for 2.0 #endif COMMON valid compatible CODE -- modified at 11:43 Monday 5th March, 2007
You're looking for '__CLR_VER' - check http://msdn2.microsoft.com/en-us/library/b0084kay.aspx. I don't believe you can change the framework you're linking to without switching compilers though.
-
You're looking for '__CLR_VER' - check http://msdn2.microsoft.com/en-us/library/b0084kay.aspx. I don't believe you can change the framework you're linking to without switching compilers though.
-
Hi, as all we know there are at least 4 different versions of .NET framework. is there any internal IDE constant, that defines wich version of the framework is expected the IDE to build for? Motivation: It's very common having various versions of the framework living in the same machine. The IDE seems to build compatible binaries with the newest framework installed on system, thus coppying the sources on another machine, makes impossible to compile the code, without, changing lots of lines of code.. COMMON valid compatible CODE #if NETFW_VERSION_1_1 1 valid code for 1.1 #else #if NETFW_VERSION 2_0 valid code for 2.0 #endif COMMON valid compatible CODE -- modified at 11:43 Monday 5th March, 2007
-
First, you're in the wrong forum for asking questions. Second, no there is no constant in C# or VB.NET that defines which version of Visual Studio and hence which version of the .NET Framework your compiling against. You can NOT switch compilers in Visual Studio. The IDE is very dependant on a specific version in order to work. If you want to switch the compilers, you'll have to compile your application entirely from the command line, specifying fully qualified paths to which version of the .NET Framework you want to use to compile your app.
Dave Kreskowiak Microsoft MVP - Visual Basic
-
Hi, as all we know there are at least 4 different versions of .NET framework. is there any internal IDE constant, that defines wich version of the framework is expected the IDE to build for? Motivation: It's very common having various versions of the framework living in the same machine. The IDE seems to build compatible binaries with the newest framework installed on system, thus coppying the sources on another machine, makes impossible to compile the code, without, changing lots of lines of code.. COMMON valid compatible CODE #if NETFW_VERSION_1_1 1 valid code for 1.1 #else #if NETFW_VERSION 2_0 valid code for 2.0 #endif COMMON valid compatible CODE -- modified at 11:43 Monday 5th March, 2007
Hi, I have isolated the relevant differences between 1.1 and 2.0 and have put them in separate classes, so when class XXX changes in a way that is relevant to me, I create class LP_XXX and give it appropriate behavior; its implementation is based on the symbols NET11 and NET20, one of which is always defined in my Visual projects, depending on which Visual Studio version I use. And yes I would have liked such symbols to exist automatically. :)
Luc Pattyn [My Articles]
-
Hi, I have isolated the relevant differences between 1.1 and 2.0 and have put them in separate classes, so when class XXX changes in a way that is relevant to me, I create class LP_XXX and give it appropriate behavior; its implementation is based on the symbols NET11 and NET20, one of which is always defined in my Visual projects, depending on which Visual Studio version I use. And yes I would have liked such symbols to exist automatically. :)
Luc Pattyn [My Articles]
Yes! thanks Luc! That's the solution I've adopted here: manually! In real world: Microsoft releases different version of the FrameWork at will. Customers has diferent versions of Framework installed. Our enterprise has 2 compiling machines, one for each framework, each with his own VS IDE We want to maintain just 1 source at a time So... what the F*)%!=) is missing an IDE constant telling us wich version of the framework is installed with the IDE, and thus making and automatic compilation.