Title: Message

Wow… that looks promising. But, ??? Does this task run automatically? How would I access this info… would it be:

 

${dll.majorversion}

 

???

 

Thanks a lot,

Bob

 

 


From: Price, Henry [mailto:[EMAIL PROTECTED]
Sent: Friday, April 30, 2004 11:41 AM
To: Bob Archer; [EMAIL PROTECTED]
Subject: RE: [Nant-users] get version from dll?

 

How about something like this? (off the top of my head and without intellisense :)

 

We've done something similar here - for checking which versions of files are installed etc - had to do it all in script - I've given up on writing custom tasks, they take too long to edit when you need to change stuff :)

 

<script language="C#">
   <code><![CDATA[
    public static void ScriptMain(Project project)
    {
      System.Diagnostics.FileVersionInfo myFileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo("path to your dll");

      project.Properties["dll.majorversion"] = myFileVersionInfo.FileMajorPart;

      project.Properties["dll.minorversion"] = myFileVersionInfo.FileMinorPart;

      project.Properties["dll.buildversion"] = myFileVersionInfo.FileBuildPart;

      project.Properties["dll.privateversion"] = myFileVersionInfo.FilePrivatePart;
    ]]></code>
  </script>

-----Original Message-----
From: Bob Archer [mailto:[EMAIL PROTECTED]
Sent: 30 April 2004 4:21P
To: [EMAIL PROTECTED]
Subject: [Nant-users] get version from dll?

Hi All,

 

I am creating a build script that deploys our last successful daily build to our QA machine.

 

How could I get the version/build number from a dll? Any ideas? I could get the last build number from the build number file that my version task uses, however, if that build failed it will not be the one in the daily build area.

 

Thanks,

Bob

 



"This communication is intended solely for the addressee and is confidential and not for third party unauthorised distribution."

Reply via email to