From: Price, H. <Hen...@th...> - 2004-04-30 15:44:04
|
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:Bob.Archer@Geac.com] Sent: 30 April 2004 4:21P To: nan...@li... 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." |