You can to that using WriteVersionToFile
MSBuild target defined below :
<PropertyGroup>
<VersionsFile>versions.txt</VersionsFile>
</PropertyGroup>
<ItemGroup>
<!-- Assemblies for which you want versions-->
<AssemblyFiles Include="Bin\**\*.dll"/>
</ItemGroup>
<Target Name="ExtractVersions">
<GetAssemblyIdentity AssemblyFiles="@(AssemblyFiles)">
<Output TaskParameter="Assemblies" ItemName="MyAssemblyIdentities"/>
</GetAssemblyIdentity>
<Message Text="%(MyAssemblyIdentities.Name) - Version %(Version)"/>
</Target>
<Target Name="WriteVersionToFile" DependsOnTargets="ExtractVersions">
<Delete Files="$(VersionsFile)" />
<WriteLinesToFile File="$(VersionsFile)"
Lines="%(MyAssemblyIdentities.Name) - %(Version)"
Overwrite="false"
Encoding="Unicode"/>
</Target>
Output file versions.txt
will look like that :
ICSharpCode.SharpZipLib - 0.85.4.369
nunit.framework - 2.4.7.0
Test.Rules - 0.2.0.0