0

I'm working on creating a simple Nant script that will utilize the assemblyname::get-version function which is documented here: http://nant.sourceforge.net/release/0.85/help/functions/assemblyname.get-version.html

I'm getting a failure "Unknown function 'version::get-major-version'. The .dll is indeed present in the directory that I'm running nant. Which I'm doing so by opening up the cmd prompt and cd'ing to the directory and using the command 'nant'

Any help is appreciated!

<target name="updater">

    <echo message = "Hello!" />
    <echo message="${version::get-major-version(assemblyname::get-version(assemblyname::get-assembly-name('nunit.util.dll')))}" />


</target>

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Nicky40
  • 35
  • 3

1 Answers1

1

The documentation of assemblyname::get-version contains a bug. If you take a look at the documentation of version functions you will find out it should be version::get-major instead of version::get-major-version.

<echo message="${version::get-major(assemblyname::get-version(assemblyname::get-assembly-name('nunit.util.dll')))}" />
The Chairman
  • 7,087
  • 2
  • 36
  • 44
  • I should be able to test this tonight, thank you a ton for the for the response. I'll report back as soon as I can confirm, but you appear to be correct. – Nicky40 Jul 29 '11 at 20:55
  • This is great, is there a way to combine the version, major, minor and revision to a single property? I'm a bit new with the combination of variables in NAnt. I'm going to attempt this now, will report back with some code snippits if successful. – Nicky40 Aug 01 '11 at 15:18
  • value="assemblyname::get-version(assemblyname::get-assembly-name('hardsetvariable')) – Nicky40 Aug 01 '11 at 17:56