anchor.diff:    ] 
     |> dict
   
  +let weightTargetProfiles possibleFrameworksInOrderOfPreference (profiles: Paket.TargetProfile list) =
  +  
  +  let relevantFrameworksWithPreferenceIndex =
  +    possibleFrameworksInOrderOfPreference
  +    |> Seq.mapi (fun i f -> f, i)
  +    |> dict
  +  
  +  let profileWithAllFrameworks =
  +    profiles
  +    |> Seq.map (fun targetProfile ->
  +      targetProfile, 
  +      match targetProfile with
  +      | Paket.SinglePlatform platform -> [platform]
  +      | Paket.PortableProfile (_, platforms) -> platforms
  +    )
  +    |> Seq.map (fun (targetProfile, profiles) ->
  +      targetProfile, 
  +      profiles
  +      |> Seq.map (fun p -> p, tryFind p relevantFrameworksWithPreferenceIndex)
  +    )
  +  
  +  // we pick the first one for which the sum of prefered indexes is the lowest
  +  let choices = 
  +    profileWithAllFrameworks
  +    |> Seq.map (fun (targetProfile, selection) -> 
  +      let sum =
  +        let selectionWithMatches =
  +          selection
  +          |> Seq.filter (snd >> Option.isSome)
  +        if selectionWithMatches |> Seq.isEmpty then
  +          Int32.MaxValue
  +        else
  +          selectionWithMatches
  +          |> Seq.map (snd)
  +          |> Seq.choose id
  +          |> Seq.sum
  +      targetProfile,sum
  +    )
  +    |> Seq.filter (snd >> ((<>) Int32.MaxValue))
  +  choices
  +
  +let makeTargetPredicate frameworks =
  +  fun (folders: Paket.LibFolder list) ->
  +    folders
  +    |> Seq.map (fun folder-> folder, weightTargetProfiles frameworks folder.Targets)
  +    |> Seq.map (fun (folder, weightedTargetProfiles) -> 
  +      folder, weightedTargetProfiles |> Seq.sumBy snd
  +    )
  +    |> Seq.sortBy snd
  +    |> Seq.map fst
  +    |> Seq.tryHead
  +
  +let frameworkIdentifiersInPreferenceOrder =
  +  [
  +  Paket.FrameworkIdentifier.DotNetFramework Paket.FrameworkVersion.V4_5
  +  Paket.FrameworkIdentifier.DotNetFramework Paket.FrameworkVersion.V4_Client
  +  Paket.FrameworkIdentifier.DotNetFramework Paket.FrameworkVersion.V3_5
  +  Paket.FrameworkIdentifier.DotNetFramework Paket.FrameworkVersion.V2
  +  ]
  +
  +let profiles = dependenciesFile.GetInstalledPackageModel(None, "Chessie")
  +for refFolder in profiles.ReferenceFileFolders do
  +  printfn "%A" (weightTargetProfiles frameworkIdentifiersInPreferenceOrder refFolder.Targets)
  +
  +let targetPredicate = makeTargetPredicate frameworkIdentifiersInPreferenceOrder
  +
  +getDllFilesWithinPackage dependenciesFile targetPredicate ("fspickler")
  +
   let packagesGraph = computePackageTopologyGraph lockFile
   
   for (group, package) in packagesGraph.Keys do
     
     printfn "= %s %s =" (group.ToString()) (package.GetCompareString())
     try
  -    let dlls = getDllFilesWithinPackage dependenciesFile (package.ToString())
  +    let dlls = getDllFilesWithinPackage dependenciesFile targetPredicate (package.ToString())
       for d in dlls do
         printfn "\t-> %s" d.Path
     with
     | e -> printfn "\t ERROR: %s" (e.ToString())
  +
  +let installModel = dependenciesFile.GetInstalledPackageModel(Some "main", "newtonsoft.json")
  +
  +for p in installModel.ReferenceFileFolders do
  +  let folderName = p.Name
  +  printfn "%s" folderName
  +  for t in p.Targets do
  +    printfn "\t-> %A" t
  
positive.code: ﻿#load "Scripts/load-project-debug.fsx"
  open System.Collections.Generic
  open System.IO
  open System.Linq
  
negative.code:     referenceByAssembly.Keys
      |> Seq.map (fun a -> a.Name.ToString(), a)
      |> dict
  
    let graph = AdjacencyGraph<_,_>()
    
  