Let\'s say I wanted to create a static text file which ships with each release. I want the file to be updated with the version number of the release (as specified in A
If (1) you don't want to download or create a custom executable that retrieves the assembly version and (2) you don't mind editing the Visual Studio project file, then there is a simple solution that allows you to use a macro which looks like this:
@(Targets->'%(Version)')
@(VersionNumber)
To accomplish this, unload your project. If the project somewhere defines a
$(PostBuildEventDependsOn);
PostBuildMacros;
echo HELLO, THE ASSEMBLY VERSION IS: @(VersionNumber)
This snippet has an example
Now as promised, the assembly version is available to your post build event with this macro:
@(VersionNumber)
Done!