Created
July 30, 2013 15:32
-
-
Save ChrisMissal/6114030 to your computer and use it in GitHub Desktop.
Search a directory and subdirectories for DLLs by name and list by Version numbers descending.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = @"C:\dev\whatever"; var dllFileName = @"something.dll"; var files = from file in new DirectoryInfo(path).GetFiles(dllFileName, SearchOption.AllDirectories) let fvi = FileVersionInfo.GetVersionInfo(file.FullName) select new { File = file.FullName, Version = fvi }; files.OrderByDescending(f => f.Version.FileMajorPart) .ThenByDescending(f => f.Version.FileMinorPart) .ThenByDescending(f => f.Version.FileBuildPart) .Dump(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment