Click here to Skip to main content
6,595,444 members and growing! (21,401 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » .NET Framework » General     Intermediate License: The Code Project Open License (CPOL)

Targeting the .NET Framework 2.0 with Visual Studio 2008

By Robin Jet

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).
C# 2.0, VB 8.0, VB 9.0, .NET CF, .NET 2.0, WinXP, Vista, .NET 3.5VS2008, Dev
Posted:17 Sep 2007
Views:33,683
Bookmarked:32 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
29 votes for this article.
Popularity: 7.00 Rating: 4.79 out of 5

1

2

3
3 votes, 10.3%
4
26 votes, 89.7%
5

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.

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

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!

License

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

About the Author

Robin Jet


Member

Occupation: Architect
Location: India India

Other popular .NET Framework articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 21 of 21 (Total in Forum: 21) (Refresh)FirstPrevNext
GeneralThank you PinmemberTodd Pichler19:22 6 Jul '09  
GeneralThank you so much! PinmemberMember 419117318:28 23 Apr '09  
GeneralMsdn reference PinmemberThaRudeDude3:19 5 Mar '09  
GeneralExcellent. Thank you. PinmemberDIren10:55 30 Jan '09  
GeneralThe frameworks and Visual Studio. Pinmemberyeya8a6:18 16 Dec '08  
GeneralExcellent - thank you. Pinmemberglassdom23:22 11 Nov '08  
GeneralThanks for posting this... PinmemberDave Buckler5:14 10 Oct '08  
GeneralHow about framework 1.1? PinmemberKarthik Murugan20:23 30 Jul '08  
GeneralRe: How about framework 1.1? Pinmemberkubben4:00 26 Sep '08  
GeneralThanks PinmemberPete BSC8:17 1 Jul '08  
GeneralOH MY GOD! Pinmemberbleach12:39 27 May '08  
GeneralHooray! PinmemberJohnBuGaGA10:07 15 May '08  
RantYawn PinmemberAlpha Nerd8:20 3 May '08  
GeneralRe: Yawn [modified] PinmemberRenniePet4:37 4 May '08  
AnswerRe: Yawn PinmemberRobin Jet4:00 5 May '08  
GeneralRe: Yawn [modified] PinmemberRobin Jet3:57 5 May '08  
GeneralRe: Yawn PinmemberAlpha Nerd13:21 23 May '08  
GeneralThank you! PinmemberAlessio Saltarin6:53 1 Apr '08  
Generalthanks PinmemberTheCardinal2:31 30 Sep '07  
GeneralWell Done! Pinmemberalby gain1:23 30 Sep '07  
GeneralFINALLY!! Pinmembermerlin98112:49 17 Sep '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 17 Sep 2007
Editor: Smitha Vijayan
Copyright 2007 by Robin Jet
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project