Introduction
With the release of Visual Studio 2008 Orcas, one of the most important issues is compatibility. What new challenges will a developer face when working with these new tools in comparison to its predecessors Visual Studio 2005 and below?
Upgrading to the new Visual Studio means installing on a few developer machines - upgrading to target a new framework (3.5) means ensuring that every client of the application has the new framework installed. With Visual Studio 2008, it's possible to target the older frameworks (2.0 and 3.0).
For a great introduction on how to make new projects or modify existing projects to target either .NET Framework 2.0, 3.0, or 3.5, please visit Luke's webpage on ".NET Framework Multi-targeting in Visual Studio 2008".
This article will take a developer through the problem I faced in converting a VS 2005 project into the VS 2008 format, yet successfully targeting the .NET Framework 2.0.
It also lists all the settings necessary to configure a VS 2008 project to target .NET 2.0 or .NET 3.0, if the developer does not want to target the latest .NET 3.5.
Background
A few days ago, I downloaded a Beta version of VS 2008 onto my Vista PC, and upgraded my Visual Studio 2005 application into the new VS 2008 format.
I then built the solution, creating a Setup file.

I followed the steps outlined in Luke's article, but when I used my client's Windows XP computer to install the program using the final Setup file…

… it forced the client to install the .NET 3.5 framework, or else would not install.

As you can see, in the Project setting of my Windows Application project, I have chosen .NET 2.0:

Then, in the Properties of the Setup project:

Then, in the Prerequisites window, .NET 2.0 has been chosen as a prerequisite:

But my final Setup file still forced me to install NET framework 3.5 on the client's PC. So what is preventing it from using 2.0?
The solution to my problem
There is another setting which you will need to configure in order for your setup program to work with NET 2.0.
Open up the Dependencies folder in your Setup project, and double-click the ".NET Framework" dependency.

A window will open up. Inside it, click the ".NET Framework" launch condition, and open the Properties window. There you will find a "Version" setting. Select whichever one you are depending on, also remember to choose the same in the dialog windows shown earlier.

When I built the setup again, it installed perfectly on the client's Windows XP computer, which only had the .NET Framework 2.0 installed!

Conclusion
So that's all you need in order to target the .NET Framework 2.0 from Visual Studio 2008!
Hope this helps you! And please forgive me if you think this article does not meet up the quality standards of The Code Project, as this is my first!
So wish me luck and good bye for now!
|
|
 |
 | You sir, are THE MAN Vik | 7:38 21 Jan '10 |
|
 |
Leave it to MS to make the developer look in 2 places to specify this.
This saved a bunch of grief for me and made a client happy. Thanks for sharing.
|
|
|
|
 |
 | Thanks. Piascas | 1:53 11 Jan '10 |
|
 |
Thanks for saving me some hours of headache. 5 to you.
|
|
|
|
 |
 | Thank you Todd Pichler | 19:22 6 Jul '09 |
|
|
 |
 | Thank you so much! Member 4191173 | 18:28 23 Apr '09 |
|
 |
This problem has been bothering me over months!
|
|
|
|
 |
 | Msdn reference ThaRudeDude | 3:19 5 Mar '09 |
|
|
 |
 | Excellent. Thank you. DIren | 10:55 30 Jan '09 |
|
 |
Excellent. Thank you.
There are 10 types of people in the world. Those who understand the binary and those who don't.
|
|
|
|
 |
 | The frameworks and Visual Studio. yeya8a | 6:18 16 Dec '08 |
|
 |
Well, i have visual Studio 2003 and visual Studio 2005 installed in my developer machine, and i have several aplication that i can't upgrade (ej: from 2003 to 2005 i can't) because its not my decision, and i only support them once in a while. Its posible to install visual Studio 2008 without upgrade my others applications?, i want to install 2008 for others web aplication and for learn.
|
|
|
|
 |
 | Excellent - thank you. glassdom | 23:22 11 Nov '08 |
|
 |
Many thanks for this piece - I'd spent ages wading through VS help & ms's overblown websites without finding this information.
|
|
|
|
 |
 | Thanks for posting this... Dave Buckler | 5:14 10 Oct '08 |
|
 |
Well found Robin... this issue had me going round in circles for hours, due to MS simply not documenting the neccessity to alter the launch condition when targeting an earlier version of the Framework.
Thanks for sharing with the rest of the community!
|
|
|
|
 |
 | How about framework 1.1? Karthik Murugan | 20:23 30 Jul '08 |
|
 |
My domain hosting supports only framework 1.1. With visual studio 2008, is it possible to target framework 1.1?
|
|
|
|
 |
|
 |
The simple answer is no. .net 2.0 framework is the lowest that VS 2008 will go.
Ben
|
|
|
|
 |
 | Thanks Pete BSC | 8:17 1 Jul '08 |
|
 |
I read the comments below... and my only comment to this article being a "Yawn" (to each their own I suppose): These articles are what embody this website. If it saves someone else 1 minute of their time (like it did for me, having moved from VS2005 to VS2008 recently; but, still need to target the 2.0 framework), I wouldn't consider that type of article a yawn.
|
|
|
|
 |
 | OH MY GOD! bleach | 12:39 27 May '08 |
|
 |
Thank you so much for pointing out that detail that's left out of the MSDN blog!
|
|
|
|
 |
 | Hooray! JohnBuGaGA | 10:07 15 May '08 |
|
 |
Thanks, man!
|
|
|
|
 |
 | Yawn Alpha Nerd | 8:20 3 May '08 |
|
 |
This is ludicrously easy that any real developer would know this.
Dim SomethingAboveMyHead As LightBulb
|
|
|
|
 |
|
 |
To Alpha Nerd: Sorry to hear about the complications following your perspective regeneration surgery.
To everyone else: The article referenced on MSDN blogs seems to be missing. Is there another link that works, or an archived version available somewhere?
Rennie
modified on Sunday, May 4, 2008 9:45 AM
|
|
|
|
 |
|
|
 |
|
 |
To AlphaNerd:
Well, its just a "difficulty" I had once and assumed that others would encounter this too.
And BTW, please inform me when admissions open. I'd really like to give the "real developer" test.
And do you use Visual Assist X? I've heard a rumor that all those "real" developers do. If not, you should really consider visiting this http://www.wholetomato.com/[^]. Click on the "Take a tour" button on the linked webpage.
"Let him who desires peace, prepare for war.." ~Vegetius Renatus
modified on Monday, May 5, 2008 9:10 AM
|
|
|
|
 |
|
 |
No, I use express which won't let you use add-ons.
I'd been called 'ugly', 'pug ugly', 'fugly', 'pug fugly' but never 'ugly ugly'. - Moe Szyslak
|
|
|
|
 |
 | Thank you! Alessio Saltarin | 6:53 1 Apr '08 |
|
 |
You saved me a lot of time. Thank you!
|
|
|
|
 |
 | thanks TheCardinal | 2:31 30 Sep '07 |
|
 |
this has save me on pulling all my hairs out
-TheCardinal
|
|
|
|
 |
 | Well Done! alby gain | 1:23 30 Sep '07 |
|
 |
Great posting - this will help out a lot of people who encounter this gotcha from the beginning.
|
|
|
|
 |
 | FINALLY!! merlin981 | 12:49 17 Sep '07 |
|
 |
You are you my hero! 5 stars
|
|
|
|
 |
|
|
Last Updated 17 Sep 2007 |
Advertise |
Privacy |
Terms of Use |
Copyright ©
CodeProject, 1999-2010