In the end I did this using NAnt xmlpoke, so for the version we end up with 20.0.dayofyear.hourminute - it is mostly unique across builds.
There is no need for custom tasks - and the newer version of MSBuild has a pokexml too, so it might work with that.
<target name="pokerevision" depends="init">
<property name="projectname" value="MyProject.GUI" />
<!-- This is a bit flawed because 231 could mean 02:31 or 23:01, but we never build before 3 am. -->
<property
name="app.revision"
value="${datetime::get-hour(datetime::now())}${datetime::get-minute(datetime::now())}" />
<echo message="revision: ${app.revision}" />
<xmlpoke
file="${Solution.Path}\${projectname}\${projectname}.csproj"
xpath="//x:Project/x:PropertyGroup[1]/x:ApplicationRevision"
value="${app.revision}"
>
<namespaces>
<namespace prefix="x" uri="http://schemas.microsoft.com/developer/msbuild/2003" />
</namespaces>
</xmlpoke>
<property
name="app.version"
value="20.0.${datetime::get-day-of-year(datetime::now())}.${app.revision}" />
<echo message="version: ${app.version}" />
<xmlpoke
file="${Solution.Path}\${projectname}\${projectname}.csproj"
xpath="//x:Project/x:PropertyGroup[1]/x:ApplicationVersion"
value="${app.version}"
>
<namespaces>
<namespace prefix="x" uri="http://schemas.microsoft.com/developer/msbuild/2003" />
</namespaces>
</xmlpoke>
</target>