I have a visual studio solution file containing multiple projects.
For a given solution configuration, say for example Dev, few of the projects are using Debug configuration. I want all projects to use Dev configuration for the Dev solution configuration.
Instead of using Configuration Manager and update each project's configuration for all possible platform option (x64, Any CPU, Mixed Platforms), I want to be able to automate this. It is very tedious using Configuration Manager to update this for all solution configuration for all projects.
Because I have more than 5 solution configuration and there are more than 20 projects in the solution.
Editing the solution file in a notepad++ would help I guess. I am yet to try this. But is this the only way?
Update:
I have drafted a simple PS script to achieve this using Powershell to update the sln file, for a single sln configuration. But looking for alternate ways as well.
$content = Get-Content "E:\SlnFolder\SolutionFile.sln" | ForEach-Object {
$line = $_
if ($line -match "(^\s*{[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+}.Dev\|[a-zA-Z0-9\.\s]+ = )([a-zA-Z\s]+)")
{
$line -replace "(^\s*{[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+}.Dev\|[a-zA-Z0-9\.\s]+ = )([a-zA-Z\s]+)",'$1Dev'
}
else
{
$line
}
} | Set-Content -Path "E:\SlnFolder\SolutionFile_Updated.sln"
There is enough room to polish this script. Will check that.