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?
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:
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 uuto revert the unchanged files.