Search code examples
c#unity-container

Unity 5.9 adds a ton of extra library references


We recently upgraded our solution to use the newly released Unity 5.9.0.

In the process, it looks like Unity added a whole ton of additional library references to each project that it's in. For instance:

   <Reference Include="System.AppContext, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>..\packages\Unity.5.9.0\lib\net47\System.AppContext.dll</HintPath>
    </Reference>
    <Reference Include="System.Collections, Version=4.0.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>..\packages\Unity.5.9.0\lib\net47\System.Collections.dll</HintPath>
    </Reference>
    <Reference Include="System.Collections.Concurrent, Version=4.0.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>..\packages\Unity.5.9.0\lib\net47\System.Collections.Concurrent.dll</HintPath>
    </Reference>
    <Reference Include="System.Collections.NonGeneric, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>..\packages\Unity.5.9.0\lib\net47\System.Collections.NonGeneric.dll</HintPath>
    </Reference>
    <Reference Include="System.Collections.Specialized, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>..\packages\Unity.5.9.0\lib\net47\System.Collections.Specialized.dll</HintPath>
    </Reference>
    <Reference Include="System.ComponentModel, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>..\packages\Unity.5.9.0\lib\net47\System.ComponentModel.dll</HintPath>
    </Reference>

Except there's about 40 or so in total, to each project.

So far as I can tell, it hasn't had any negative repercussions so far, but I certainly don't want all these references in each project if we don't need them.

Is this actually necessary? Or is it a bug in the new 5.9 (in the nuget configuration, maybe?) that's going to need to get fixed?


Solution

  • FWIW, when I upgraded to Unity 5.9.3, it removed all those extra references. So my assumption is that this was a bug in Unity 5.9.0 through 5.9.2.