Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-13801

CLONE - nuspec targetFramework not considered while installing a nuget package

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 4.8.1
    • Fix Version/s: 4.8.0
    • Component/s: NuGet
    • Labels:
      None
    • Environment:

      Visual Studio 2015
      NuGet 3.4.4

      Description

      When installing a package containing distinct dependencies depending on targeted framework, all dependencies are pulled and installed, regardless of the current project framework.

      For instance, installing package reactiveui-core.6.5.0.nupkg through artifactory on a .Net 4.5 project will fail with error message:

      Could not install package 'Rx-WinRT 2.2.5'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

      Despite nuspec being correctly written:

       <?xml version="1.0"?>
      <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
        <metadata>
          <id>reactiveui-core</id>
          <version>6.5.0</version>
          <authors>Paul Betts</authors>
          <owners>Paul Betts</owners>
          <licenseUrl>http://opensource.org/licenses/ms-pl.html</licenseUrl>
          <projectUrl>http://www.reactiveui.net</projectUrl>
          <requireLicenseAcceptance>false</requireLicenseAcceptance>
          <description>An MVVM library for .NET that is deeply integrated with the Reactive Extensions</description>
          <language>en-us</language>
          <dependencies>
            <group>
              <dependency id="Rx-Main" version="2.2.5" />
              <dependency id="Splat" version="[1.0, 2.0)" />
            </group>
            <group targetFramework="Windows8.0">
              <dependency id="Rx-Main" version="2.2.5" />
              <dependency id="Splat" version="[1.0, 2.0)" />
              <dependency id="Rx-Xaml" version="2.2.5" />
              <dependency id="Rx-WinRT" version="2.2.5" />
            </group>
            <group targetFramework="WindowsPhone8.0">
              <dependency id="Rx-Main" version="2.2.5" />
              <dependency id="Splat" version="[1.0, 2.0)" />
              <dependency id="Rx-Xaml" version="2.2.5" />
              <dependency id="Rx-WinRT" version="2.2.5" />
            </group>
            <group targetFramework=".NETFramework4.5">
              <dependency id="Rx-Main" version="2.2.5" />
              <dependency id="Splat" version="[1.0, 2.0)" />
              <dependency id="Rx-Xaml" version="2.2.5" />
            </group>
            <group targetFramework=".NETPortable0.0-Win81+Wpa81">
              <dependency id="Rx-Main" version="2.2.5" />
              <dependency id="Splat" version="[1.0, 2.0)" />
              <dependency id="Rx-Xaml" version="2.2.5" />
              <dependency id="Rx-WinRT" version="2.2.5" />
            </group>
          </dependencies>
        </metadata>
      </package>
      

      Changing NuGet source in Visual Studio 2015 from Artifactory to standard NuGet.org or even a local file system repository solves the issue.

      The issue is also not occuring using older NuGet 2.8 in my other Visual Studio 2012 with Artifactory.

      Let me know if you need more info.

      Any help appreciated!

        Attachments

          Activity

            People

            • Assignee:
              oferc Ofer Cohen (Inactive)
              Reporter:
              rhautefeuille Romain Hautefeuille
              Assigned QA:
              Gal Raif
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: