Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the Target Framework for all my projects in a Visual Studio 2008 to 3.5 [duplicate]

Possible Duplicate:
Change the Target Framework for all my projects in a Visual Studio Solution

I have a just converted a Visual Studio project from 2005 to 2008 to take advantage of the .NET 3.5 Framework features. My solution contains approximately 80 projects and I want to set the Target Framework to .NET Framework 3.5 for all of them. Is there a way I can do this without manually going in and changing them one-by-one in Properties -> Application -> Target Framework?

like image 832
Ryan Spears Avatar asked Dec 16 '09 12:12

Ryan Spears


1 Answers

You would need to edit all the .csproj files and change the line:

<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

You could write a program that would scan your projects folders for all .csproj files, read them as text (or perhaps xml), update that line and then write them out again.

You might have an issue though if they're not already VS 2008 projects. So convert them first. And as you're doing that it'll probably be just as quick (if not quicker) to update the target framework version by hand.

Having said that, why not leave it alone until you make code changes the project anyway. As your code works now, and the only reason you want to update is to make use of the new features you're going to have to edit the project anyway.

like image 95
ChrisF Avatar answered Nov 15 '22 12:11

ChrisF