I’m trying to find, using Powershell, the AssemblyFileVersion of a deployed Sharepoint solution.
So far I manage to find that info about the solution itself, but now I’m trying to find the same about it’s references.
Is there a way to get that data.
Here’s my code so far
$assembly = [System.Reflection.Assembly]::LoadWithPartialName("<AssemblyName>")
$fvi = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($assembly.Location)
Write-Host "File Version Number " $fvi.ProductVersion
$references = $assembly.GetReferencedAssemblies();
foreach ($ref in $references)
{
Write-Host $ref.Version
}
The $ref.Version returns the AssemblyVersion which is not the same.
I tryed the same approach ([System.Reflection.Assembly]::LoadWithPartialName) but it does not work. I’m gessing that the fact that this is a sharepoint solution as an impact on this.
I was looking for a solution and find
ReflectionOnlyLoadmethod which might help you.It recursively checks for all the dependencies. The
$processedcache is there so that it ends finally 🙂