0

I use visual studio 2015 and when I want to use a nuget package(includes .netcore and .net versions both) from my .net45 project that time nuget package manager try to resolve .netcore depencies and failed.What I am waiting if my project is .net45 that time only try to resolve target framework 4.5 depencies but nuget try to resolve .NETStandard1.3 dependecies too. Am I missing something or is this design behaviour of nuget?

nuspec file like that

<dependencies>
      <group targetFramework=".NETFramework4.5">
        <dependency id="librdkafka.redist" version="0.11.0" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETFramework4.6">
        <dependency id="librdkafka.redist" version="0.11.0" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETStandard1.3">
        <dependency id="NETStandard.Library" version="1.6.1" exclude="Build,Analyzers" />
        <dependency id="librdkafka.redist" version="0.11.0" exclude="Build,Analyzers" />
        <dependency id="System.Console" version="4.3.0" exclude="Build,Analyzers" />
        <dependency id="System.Linq" version="4.3.0" exclude="Build,Analyzers" />
        <dependency id="System.Runtime.InteropServices" version="4.3.0" exclude="Build,Analyzers" />
        <dependency id="System.Runtime.Extensions" version="4.3.0" exclude="Build,Analyzers" />
        <dependency id="System.Threading" version="4.3.0" exclude="Build,Analyzers" />
      </group>
    </dependencies> 
Bilgehan
  • 1,135
  • 1
  • 14
  • 41
  • According to your description, I create a sample package based on your dependencies. Please try install my package from below link: https://1drv.ms/u/s!AkHKK8SV6beshi6VjSOrxexDj0aD If it could install correct in your project, the problem should be related to your package. Otherwise, there has any problem in your Visual Studio 2015. – Weiwei Oct 12 '17 at 03:15
  • @Bilgehan, Can not reproduce. Could you share us more detail steps to reproduce this issue, your complete .nuspec file and what is the project type you installed on this package? – Leo Liu Oct 12 '17 at 09:26
  • https://www.nuget.org/packages/Confluent.Kafka/ I try to use this file,can you download on your visual studio? – Bilgehan Oct 12 '17 at 13:07
  • @Bilgehan, yes, I can download that package and it works fine for .NET framework 4.5 project. How did you install it and what is your project type? .NET framework? I have created a sample sample, you can check it, or you can share us a video how did you reproduce this issue. https://1drv.ms/i/s!Ai1sp_yvodHfeN8dmR0SOa4Awd0 – Leo Liu Oct 13 '17 at 01:40
  • I use visual studio nuget package manager screen,I can download it and I can use it when I upgrade my nuget version extension in my visual studio but my client who has older versions of nuget extensions failed because of .net core dependicies – Bilgehan Oct 13 '17 at 05:23
  • @Bilgehan, What is the version of your older versions nuget extensions? Have you try to update it, then check if it works fine? If this issue still occur on the latest version, I think you may need to share us some detail steps to reproduce this issue. – Leo Liu Oct 13 '17 at 07:03
  • Yes nuget 3.6 works fine but older versisons are (before 2.12 ) has problems – Bilgehan Oct 13 '17 at 12:02

1 Answers1

0

nuget vs2015 Cannot Resolve Group Target Dependicies Correctly

According to the troubleshooting on above comments, you need update your nuget extensions after the 2.12 version. That because starting with nuget 2.12, nuget support full NetStandard and NetCoreApp. You can refer to the nuget release note for 2.12:

•Full NetStandard and NetCoreApp support for VS2013

So, to resolve this issue, please update your nuget extensions first.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135