0

I've created a simple nuget package containing one assembly that is located under lib\net40.

If I unzip the nuget package I can verify that the assembly is indeed present under lib\net40.

Now, when I install this package in my .net project using the Visual Studio Nuget UI, the assembly gets unpacked in the wrong folder. It is not unpacked under packages\my_package\lib\net40 as I would expect, but under packages\my_package\lib\net20.

The assembly is a .net-2.0 library, so you could argue that my Nuget package is wrong, but is this intended&documented behavior, or what else can be the reason that the assembly is not unpacked under net40 as I would expect?

Merijn
  • 661
  • 1
  • 7
  • 21
  • What NuGet version do you use? – Jeroen Heier Feb 06 '17 at 21:08
  • Look also at [this](https://learn.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks) page: "When NuGet installs an assembly from a package, it checks the target .NET Framework version of the project, then selects the correct version of the assembly from the appropriate subfolder under lib in the package". No mention of another folder. Maybe a Powershell command is executed as part of the installation? – Jeroen Heier Feb 06 '17 at 21:19
  • I'm using nuget version 3.5.0.1938 – Merijn Feb 07 '17 at 08:16

1 Answers1

0

I just found out what happened. It was a silly name clash between a company-internal nuget package and a corresponding package on nuget.org. I was expecting that Nuget was picking up our own version that has the lib/net40 folder. Instead however, nuget picked the version from nuget.org which has a lib/net20 folder.

Merijn
  • 661
  • 1
  • 7
  • 21