Click here to Skip to main content
13,293,474 members (59,542 online)
Click here to Skip to main content
Add your own
alternative version


42 bookmarked
Posted 17 Sep 2007

Targeting the .NET Framework 2.0 with Visual Studio 2008

, 17 Sep 2007
Rate this:
Please Sign up or sign in to vote.
Upgrading to a 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).


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.


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.

Screenshot - image002.jpg

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…

Screenshot - image004.jpg

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

Screenshot - image006.jpg

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

Screenshot - image008.jpg

Then, in the Properties of the Setup project:

Screenshot - image010.jpg

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

Screenshot - image012.jpg

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.

Screenshot - image014.jpg

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.

Screenshot - image016.jpg

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!

Screenshot - image018.jpg


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!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Robin Jet
India India
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionHelpful Pin
Jayco2927-Feb-14 1:17
memberJayco2927-Feb-14 1:17 
GeneralMy vote of 5 Pin
Menon Santosh28-Nov-11 20:10
memberMenon Santosh28-Nov-11 20:10 
GeneralMy vote of 5 Pin
Member 389896627-Nov-11 7:39
memberMember 389896627-Nov-11 7:39 
GeneralThanks, you made my day Pin
leftbox15-Mar-11 13:33
memberleftbox15-Mar-11 13:33 
GeneralMy vote of 5 Pin
a_kiani24-Jul-10 22:56
membera_kiani24-Jul-10 22:56 
GeneralThanks Pin
Lucifier_XZ21-May-10 23:32
memberLucifier_XZ21-May-10 23:32 
Big thanks.
Generalthanks a lot!!!!! Pin
silverchen040230-Mar-10 0:46
membersilverchen040230-Mar-10 0:46 
GeneralYou sir, are THE MAN Pin
Vik21-Jan-10 7:38
memberVik21-Jan-10 7:38 
GeneralThanks. Pin
Piascas11-Jan-10 1:53
memberPiascas11-Jan-10 1:53 
GeneralThank you Pin
Todd Pichler6-Jul-09 19:22
memberTodd Pichler6-Jul-09 19:22 
GeneralThank you so much! Pin
Member 419117323-Apr-09 18:28
memberMember 419117323-Apr-09 18:28 
GeneralMsdn reference Pin
ThaRudeDude5-Mar-09 3:19
memberThaRudeDude5-Mar-09 3:19 
GeneralExcellent. Thank you. Pin
DIren30-Jan-09 10:55
memberDIren30-Jan-09 10:55 
GeneralThe frameworks and Visual Studio. Pin
yeya8a16-Dec-08 6:18
memberyeya8a16-Dec-08 6:18 
GeneralExcellent - thank you. Pin
glassdom11-Nov-08 23:22
memberglassdom11-Nov-08 23:22 
GeneralThanks for posting this... Pin
Dave Buckler10-Oct-08 5:14
memberDave Buckler10-Oct-08 5:14 
QuestionHow about framework 1.1? Pin
Karthik Murugan30-Jul-08 20:23
memberKarthik Murugan30-Jul-08 20:23 
AnswerRe: How about framework 1.1? Pin
kubben26-Sep-08 4:00
memberkubben26-Sep-08 4:00 
GeneralThanks Pin
Pete BSC1-Jul-08 8:17
memberPete BSC1-Jul-08 8:17 
GeneralOH MY GOD! Pin
bleach27-May-08 12:39
memberbleach27-May-08 12:39 
GeneralHooray! Pin
JohnBuGaGA15-May-08 10:07
memberJohnBuGaGA15-May-08 10:07 
RantYawn Pin
Alpha Nerd3-May-08 8:20
memberAlpha Nerd3-May-08 8:20 
GeneralRe: Yawn [modified] Pin
RenniePet4-May-08 4:37
memberRenniePet4-May-08 4:37 
AnswerRe: Yawn Pin
Robin Jet5-May-08 4:00
memberRobin Jet5-May-08 4:00 
GeneralRe: Yawn [modified] Pin
Robin Jet5-May-08 3:57
memberRobin Jet5-May-08 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 17 Sep 2007
Article Copyright 2007 by Robin Jet
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid