Skip to content

Localized assemblies are incorrectly referenced #439

Closed

Description

@isaacabraham

If you have a dependency on a package that contains localized (satellite) resources, Paket incorrectly references all of them simultaneously. Here's one from System.Spatial: -

<Choose>
    <When Condition="$(TargetFrameworkIdentifier) == 'Silverlight' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v5.0')">
      <ItemGroup>
        <Reference Include="System.Spatial">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\System.Spatial.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\de\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\es\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\fr\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\it\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\ja\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\ko\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\ru\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\zh-Hans\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\sl4\zh-Hant\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile44') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile78')">
      <ItemGroup>
        <Reference Include="System.Spatial">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\System.Spatial.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\de\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\es\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\fr\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\it\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\ja\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\ko\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\ru\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\zh-Hans\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net45+wp8+win8+wpa\zh-Hant\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch')">
      <ItemGroup>
        <Reference Include="System.Spatial">
          <HintPath>..\..\packages\System.Spatial\lib\net40\System.Spatial.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\de\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\es\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\fr\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\it\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\ja\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\ko\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\ru\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\zh-Hans\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\net40\zh-Hant\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkProfile) == 'Profile5') Or ($(TargetFrameworkProfile) == 'Profile6') Or ($(TargetFrameworkProfile) == 'Profile14') Or ($(TargetFrameworkProfile) == 'Profile19') Or ($(TargetFrameworkProfile) == 'Profile24') Or ($(TargetFrameworkProfile) == 'Profile37') Or ($(TargetFrameworkProfile) == 'Profile42') Or ($(TargetFrameworkProfile) == 'Profile47') Or ($(TargetFrameworkProfile) == 'Profile147') Or ($(TargetFrameworkProfile) == 'Profile158')">
      <ItemGroup>
        <Reference Include="System.Spatial">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\System.Spatial.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\de\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\es\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\fr\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\it\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\ja\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\ko\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\ru\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\zh-Hans\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Spatial.resources">
          <HintPath>..\..\packages\System.Spatial\lib\portable-net40+sl5+wp8+win8+wpa\zh-Hant\System.Spatial.resources.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

You then end up with warnings in VS because you're referencing the same resources assembly multiple times, and it just picks one of them (seemingly at random).

Warning No way to resolve conflict between "System.Spatial.resources, Version=5.6.3.0, Culture=zh-Hant, PublicKeyToken=31bf3856ad364e35" and "System.Spatial.resources, Version=5.6.3.0, Culture=zh-Hans, PublicKeyToken=31bf3856ad364e35". Choosing "System.Spatial.resources, Version=5.6.3.0, Culture=zh-Hant, PublicKeyToken=31bf3856ad364e35" arbitrarily.

Activity

  1. added a commit that references this issue on Dec 9, 2014
    7607061
  2. added a commit that references this issue on Dec 9, 2014
    4194214
  3. Flohack74 commented on Jan 14, 2022

    @Flohack74

    Humm so how are we supposed to get the satellite assemblies into the output folder then? This is a problem for larger frameworks like DevExpress. Currently we have a custom build step in an msbuild config that copies them manually - cumbersome and can lead to issues if DevExpress adds/removes libs.
    Like for example:
    grafik
    Would be nice if this can be automated somehow...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions