0

I am trying to find a solution, how can I update release notes in the nuspec xml using MSBuild script.

Now I have create MSBuild target with XmlUpdate:

<XmlUpdate  Prefix="n"
    Namespace="$(Namespace)"
    XmlFileName="%(Files.Name)"
    Xpath="/n:package/n:metadata/n:releaseNotes"
    Value="$(ReleaseNote)"/>

This works fine, but only in case Nuspec file already contains entry.

How can I proceed with files, where releaseNotes is not present at all? Can I somehow get number from xpath, and if it is zero, use another function for xml update?

P.S.: NuGetPack extension from MSBuildTasks does not work with package metagata.

Alex
  • 842
  • 11
  • 33

1 Answers1

0

Since nothing found, implemented custom MSBuild task according to Microsoft Task Writing reference

Alex
  • 842
  • 11
  • 33