I have solution sln, that has many csproj projects (P1.csproj, P2.csproj, P3.csproj...).
anyone know a way to programmatically (using scripting-commandline, APIs, or SDKs) read the list of all csproj projects in a VS2008 of sln file?
I have solution sln, that has many csproj projects (P1.csproj, P2.csproj, P3.csproj...).
anyone know a way to programmatically (using scripting-commandline, APIs, or SDKs) read the list of all csproj projects in a VS2008 of sln file?
just read the list from *.sln file. There are "Project"-"EndProject" sections.
Here is an article from MSDN.
If you write your program as Visual Studio Add-in you can access the EnvDTE
to find out all the projects within the currently opened solution.
Here's a PowerShell script that retrieves project details from a .sln file:
Get-Content 'Foo.sln' |
Select-String 'Project\(' |
ForEach-Object {
$projectParts = $_ -Split '[,=]' | ForEach-Object { $_.Trim('[ "{}]') };
New-Object PSObject -Property @{
Name = $projectParts[1];
File = $projectParts[2];
Guid = $projectParts[3]
}
}