Skip to content

Instantly share code, notes, and snippets.

@ctaggart
Created June 8, 2014 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctaggart/199626590034267c79ef to your computer and use it in GitHub Desktop.
Save ctaggart/199626590034267c79ef to your computer and use it in GitHub Desktop.
print the assembly version attributes for each dll
open System
open System.IO
open System.Reflection
Directory.GetFiles(".","*.dll",SearchOption.TopDirectoryOnly) |> Seq.iter (fun f ->
printfn "%s" f
let a = Assembly.LoadFrom f
match a.GetCustomAttribute<AssemblyVersionAttribute>() with
| null -> ()
| v -> printfn " Version: %s" v.Version
match a.GetCustomAttribute<AssemblyFileVersionAttribute>() with
| null -> ()
| fv -> printfn " FileVersion: %s" fv.Version
match a.GetCustomAttribute<AssemblyInformationalVersionAttribute>() with
| null -> ()
| iv -> printfn " InformationalVersion: %s" iv.InformationalVersion
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment