Allow Specifying Unreferenced Assemblies

Issue: 263

Related Issue: 981

Discussion: Designer Assemblies


Problem statement

There are three different cases here.

    1. Designer: You have a set of assemblies that should not be referenced, and should not be copied to bin, but most be placed next to the runtime assemblies. 
    2. xUnit: You have a set of assemblies that should be referenced, but from a directory other than lib.
    3. Runtime only assemblies: You have a set of assemblies that should not be referenced, but should be copied to bin.


We need a way to opt into these scenarios.

Proposal 1: New <references> element in within the <metadata> section of NuSpec.

If this element is omitted, we get the normal behavior. If it’s specified, only assemblies listed in the section are referenced and they’re referenced from wherever they may be located.

  <reference file="xunit.dll" />
  <reference file="xunit.extensions.dll" />


  • The reference element's file attribute must only specify the file name, and not a path to the file.
  • We’re handling Scenario #1 directly.
  • Scenario #2 can be accomplished by having copies in both Tools/Lib if the author cares about having the tool loaded into the PS path. Otherwise package author can move assemblies and runner into lib.
  • Not handling scenario #3.

Open Questions

  • How do we handle copying assemblies to the output folder if they’re not referenced?

Last edited Aug 2, 2011 at 5:39 PM by Haacked, version 7