Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9191419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:40:43+00:00 2026-06-17T20:40:43+00:00

We have many solutions containing hundreds of projects. During migration to new version of

  • 0

We have many solutions containing hundreds of projects. During migration to new version of VisualStudio we have to change target framework version for all projects. But it is very ineffective to change this setting by clicking project by project Properties/Application/TargetFramework.

Can we change version of all projects in a solution at once?
Is there some way to do this activity automatically/programatically?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:40:44+00:00Added an answer on June 17, 2026 at 8:40 pm

    csproj files are nothing but XML, editing the programmatically is easy enough.

    Here’s a little app I have created that utilises Linq-Xml to find and update all csproj files under a root folder:

    var path = @"--Path to Root--";
    var files = Directory.GetFiles(path, "*.csproj", SearchOption.AllDirectories);
    
    XNamespace ns = "http://schemas.microsoft.com/developer/msbuild/2003";
    
    foreach (var file in files)
    {
        var doc = XDocument.Load(file);
        var element = doc.Descendants(ns + "TargetFrameworkVersion").Single();
        element.Value = "v4.5";
        doc.Save(file);
    }
    

    As you have tagged this as tfs, you may need to perform a checkout on all the csproj files, to remove the read-only flag. Or, alternatively, just check out everything and then use tfpt uu to revert the unchanged files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large solution containing many projects with one of them being a
I have a large solution containing many projects. Due to the size and number
I have many solutions, each solution containing at least one project (lets supose they
I have a large solution containing many C# projects. When I open the solution
This should be really simple, but I have tried many solutions posted on the
I have three solutions which build two clients and a server, and share many
I have a solution with many projects. In Visual Studio 2010, clicking properties for
I have a solution which has many projects inside it. I build the solution
If I have a big file containing many zeros, how can i efficiently make
I have this code: String s = A very long string containing + many

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.