I am looking for an MSBuild task/script that will allow me to control the version of an old VB6 project?
The .vbp stores the version information as .ini style, but I cannot find a simple way to read and write the three entries.
I always use the FileUpdate-task from the MSBuildCommunityTasks, found on http://msbuildtasks.tigris.org/
You can use regular expressions to find the pattern and then replace in the text you want. For example: to replace the versionnumber in an assembly-info.cs:
<FileUpdate Files="@(VersioningAssemblyInfoFiles)"
Regex="AssemblyFileVersion\(".*"\)\]"
ReplacementText="AssemblyFileVersion("$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)")]" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With