Skip to content

Commit

Permalink
Use AssemblyReader from FSharp.Data
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Dec 6, 2015
1 parent 798aeea commit 7fa2f5a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Paket.Core/PackageMetaData.fs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,26 @@ let loadAssemblyId buildConfig buildPlatform (projectFile : ProjectFile) =
projectFile.GetAssemblyName()) |> normalizePath

traceVerbose <| sprintf "Loading assembly metadata for %s" fileName
let xs =
ProviderImplementation.AssemblyReader.ILModuleReaderAfterReadingAllBytes(
fileName,
ProviderImplementation.AssemblyReader.mkILGlobals ProviderImplementation.AssemblyReader.ecmaMscorlibScopeRef,
true)

let extractAttr (inp: ProviderImplementation.AssemblyReader.ILCustomAttr) =
let args = ProviderImplementation.AssemblyReader.decodeILCustomAttribData xs.ILGlobals inp
[| for arg in args -> arg |]


let ys =
[| for a in xs.ILModuleDef.CustomAttrs.Elements do
yield extractAttr a |]


let bytes = File.ReadAllBytes fileName
let assembly = Assembly.Load bytes

failwithf "%A %s" xs.ILModuleDef.CustomAttrs.Elements (assembly.GetName().Name)
assembly,assembly.GetName().Name,fileName

let loadAssemblyAttributes fileName (assembly:Assembly) =
Expand Down

0 comments on commit 7fa2f5a

Please sign in to comment.