I\'m currently migrating a big solution (~70 projects) from VS 2005 + .NET 2.0 to VS 2008 + .NET 3.5. Currently I have VS 2008 + .NET 2.0.
The problem is that I need
This extended version of the PS Script from Danny Tuppeny shows both Project and External references:
Function Get-ProjectReferences($rootPath)
{
$projectFiles = Get-ChildItem $rootPath -Filter *.csproj -Recurse
$ns = @{ defaultNamespace = "http://schemas.microsoft.com/developer/msbuild/2003" }
$projectFiles | ForEach-Object {
$projectFile = $_ | Select-Object -ExpandProperty FullName
$projectName = $_ | Select-Object -ExpandProperty BaseName
$projectXml = [xml](Get-Content $projectFile)
$projectReferences = $projectXml | Select-Xml '//defaultNamespace:ProjectReference/defaultNamespace:Name' -Namespace $ns | Select-Object -ExpandProperty Node | Select-Object -ExpandProperty "#text"
$projectReferences | ForEach-Object {
"PR:[" + $projectName + "]:[" + $_ + "]"
}
}
$projectFiles | ForEach-Object {
$projectFile = $_ | Select-Object -ExpandProperty FullName
$projectName = $_ | Select-Object -ExpandProperty BaseName
$projectXml = [xml](Get-Content $projectFile)
$externalReferences = $projectXml | Select-Xml '//defaultNamespace:Reference/@Include' -Namespace $ns
$externalReferences | ForEach-Object {
"ER:[" + $projectName + "]:[" + $_ + "]"
}
}
}
Get-ProjectReferences "C:\projects" | Out-File "C:\temp\References.txt"
It will give a colon-separated file that can be opened and analysed in Excel.