I use nant to release and publish my applications and it manualy set
the revision number when compiling.
Heres a snippet...
<exec program="${msBuild.exe}">
<arg value="${ProjectFile}" />
<arg value="/target:rebuild" />
<arg value="/p:Configuration=${SolutionConfiguration}" />
<arg value="/p
ublisherName="${Publisher}"" />
<arg if="${ProductName!=''}"
value="/p
roductName="${ProductName}"" />
<arg if="${CurrentVersion!=''}"
value="/p:ApplicationVersion="${CurrentVersion}.*"" />
<arg if="${PublishRevision!=''}"
value="/p:ApplicationRevision="${PublishRevision}"" />
<arg if="${OutputPath!=''}"
value="/p:OutputPath="${OutputPath}/"" />
<arg if="${ReferencePath!=''}"
value="/p:ReferencePath="${ReferencePath}"" />
<arg if="${InstallUrl!=''}"
value="/p
ublishUrl="${InstallUrl}"" />
<arg if="${InstallUrl!=''}"
value="/p:InstallUrl="${InstallUrl}"" />
<arg if="${InstallUrl!=''}"
value="/p:UpdateUrl="${InstallUrl}"" />
<arg if="${SupportUrl!=''}"
value="/p:SupportUrl="${SupportUrl}"" />
<arg value="/verbosity:normal" />
</exec>
Most of the arguments are so that it generates the correct publish data
including setting the version and revision numbers.
I get the version number from an xml configuration file I keep with the
nant script. The version is automatically incremented each week and the
revision each build.