When I do a release build of my application I copy all files needed to run the program to a folder. I want that folder name to contain the assembly version.
The build command I have partially works. I can get the version number into a file called tmpfile. The problem seems to be reading the version number from that file into a variable.
if $(ConfigurationName) == Release (
powershell "(Get-Item -path $(TargetPath)).VersionInfo.ProductVersion" > tmpfile
set /p VER=< tmpfile
echo %VER% > fileversion
set "DIRNAME=FilterUtilityApp%VER%"
xcopy /s /y "$(TargetDir)*" "$(SolutionDir)%DIRNAME%\"
xcopy /y "$(ProjectDir)Docs\*" "$(SolutionDir)%DIRNAME%\Docs\"
)
I have tested the lines where I read and write VER using a CMD window, and the commands work, fileversion contains the version number. When I run the build script, fileversion contains "Echo is on", which I assume means that VER is blank. There may be other problems with my build command, but I am stuck at this point of reading in the version number.