I am using visual studio 2010 professional edition.
I have a number of projects and solutions with the PlatformTarget set to x86 and i need to change that to AnyCPU.

It is not feasible to do it manually, since there are too many projects, so i was wondering if there is an existing macro or script that can do the conversion automatically for all projects.

If there is no such macro/script and i have to write a conversion application myself, what would be a good way to perform this conversion (simple string replace in the csproj files or is there a better way)?

1 Answer
1

Sub ChangePlatformTarget()
For Each proj As Project In DTE.Solution.Projects
Debug.WriteLine(proj.Name)
If Not proj.ConfigurationManager Is Nothing Then
ChangeProject(proj)
Else
'it's a folder, do something else with it...
End If
Next
End Sub
Sub ChangeProject(proj As Project
Dim prop As [Property] = proj.ConfigurationManager.ActiveConfiguration.Properties.Item("PlatformTarget")
prop.Value = "AnyCPU"
End Sub