Reading and editing an .ini file using MSBuild

Am I looking for an MSBuild / script task that will allow me to manage a version of an old VB6 project?

.vbp stores version information as an .ini-style, but I cannot find an easy way to read and write three records.

+3
source share
2 answers

I always use the FileUpdate task from MSBuildCommunityTasks found at http://msbuildtasks.tigris.org/

You can use regular expressions to find a pattern and then replace in the desired text. For example: to replace the version number in the assembly-info.cs:

<FileUpdate Files="@(VersioningAssemblyInfoFiles)"
                  Regex="AssemblyFileVersion\(&quot;.*&quot;\)\]"
                  ReplacementText="AssemblyFileVersion(&quot;$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)&quot;)]" />
+5
source

I'm not sure if it is implemented in any library

, GetPrivateProfileString.

XML exec MSBUILD, xml msbuild more .

+1

Source: https://habr.com/ru/post/1721133/


All Articles