anchor.diff:      tracefn "Creating .nuspec file at %s" specFile
       fi.CopyTo(specFile,true) |> ignore
   
  +    let getFrameworkGroup (frameworkTags: (string*string) seq) =
  +        frameworkTags
  +          |> Seq.map (fun (frameworkVersion, tags) -> sprintf "<group targetFramework=\"%s\">%s</group>" frameworkVersion tags)
  +          |> toLines
  +
  +    let getGroup items toTags =
  +        if items = [] then "" else
  +        sprintf "<group>%s</group>" (items |> toTags)
  +
  +    let getReferencesTags references =
  +        references
  +          |> Seq.map (fun assembly -> sprintf "<reference file=\"%s\" />" assembly)
  +          |> toLines
  +
  +    let references = getGroup parameters.References getReferencesTags
  +
  +    let referencesByFramework =
  +        parameters.ReferencesByFramework
  +          |> Seq.map (fun x -> (x.FrameworkVersion, getReferencesTags x.References))
  +          |> getFrameworkGroup
  +
  +    let referencesXml =
  +        sprintf "<references>%s</references>" (references + referencesByFramework)
  +
       let getDependenciesTags dependencies =
           dependencies
             |> Seq.map (fun (package,version) -> sprintf "<dependency id=\"%s\" version=\"%s\" />" package version)
             |> toLines
   
  -    let dependencies =
  -        if parameters.Dependencies = [] then "" else
  -        sprintf "<group>%s</group>" (getDependenciesTags parameters.Dependencies)
  +    let dependencies = getGroup parameters.Dependencies getDependenciesTags
   
       let dependenciesByFramework =
           parameters.DependenciesByFramework
  -          |> Seq.map (fun x -> sprintf "<group targetFramework=\"%s\">%s</group>" x.FrameworkVersion (getDependenciesTags x.Dependencies))
  -          |> toLines
  +          |> Seq.map (fun x -> (x.FrameworkVersion, getDependenciesTags x.Dependencies))
  +          |> getFrameworkGroup
   
       let dependenciesXml = 
           sprintf "<dependencies>%s</dependencies>" (dependencies + dependenciesByFramework)
  
positive.code:          "@releaseNotes@",parameters.ReleaseNotes
           "@copyright@",parameters.Copyright]
           |> List.map (fun (placeholder, replacement) -> placeholder, xmlEncode replacement)
           |> List.append (["@dependencies@", dependenciesXml])
  
      processTemplates replacements [specFile]
      tracefn "Created nuspec file %s" specFile
  
negative.code:     Copyright = null
      Dependencies = []
      DependenciesByFramework = []
      References = []
      ReferencesByFramework = []
      OutputPath = "./NuGet"
      WorkingDir = "./NuGet"
      PublishUrl = null
  