0

I am trying to mark my make project build with SVN revision number.

I am using MsBuildTask for updating the AssemblyVersionFile details.

I am using the following BuildScript to get the info , but this is returning -1 as SVNVersion.exe is returning Unversioned Directory, How do I update SVNVersion.exe

<Target Name="BeforeBuild">
    <SvnVersion LocalPath="$(MSBuildProjectDirectory)" ToolPath="$(ProgramFiles)\TortoiseSVN\bin">

   <Output TaskParameter="Revision" PropertyName="Revision" />

    </SvnVersion>


    <FileUpdate Files="Properties\AssemblyInfo.cs"
     Regex="(\d+)\.(\d+)\.(\d+)\.(\d+)"
  ReplacementText="$1.$2.$3.$(Revision)" />

</Target>
Simsons
  • 12,295
  • 42
  • 153
  • 269

2 Answers2

0

You must not update svnversion (for which reasons you think update is solution), but get correct, working string** for running svnversion, in order to get result.

Read svnversion --help, note format of command line

svnversion [OPTIONS] [WC_PATH [TRAIL_URL]]

and remark

If WC_PATH is an unversioned path, the program will output 'Unversioned directory' or 'Unversioned file'.

I.e - build command-line for task, which check needed you versioned directory, not some strange non-WC location

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

This is because you are using a old version of svnversion.

Try to open the Command Line Prompt, navigate to the svnversion directory and do the same job as the MSBuild.

CMD:

cd C:\ProgramFiles\TortoiseSVN\bin
[ENTER]
svnversion C:\VisualStudio\Projects\YourDirectory
[ENTER]

SVNVERSION should answer why its not working, in my case was by E155021: This client is too old to work with thew working copy at...
  • Is `svnversion` a part of the TortioseSVN distribution? I can't find it in my `/bin` folder. – ysap Sep 15 '14 at 18:51
  • 1
    Yes, it is was a part of the command line tools package, which I did not install initially. Just had to re-run the installer and update the installation. – ysap Sep 17 '14 at 16:28