0

I start a blank VS 2015 project from scratch; for this test I chose new console app. The new project is targeting framework 4.5.1. I manage Nuget packages for the solution. I look for a Nuget package recently upgraded to 4.6.1. I cannot see it as expected since my project cannot use it.

Prior to upgrading that package, many previous versions were listed as available. After the upgrade, none are available, even those targeting previous framework versions. Upgrading my test project to 4.6.1 makes the latest version and all previous versions available. This is happening with multiple packages, and the packages themselves have no package dependencies.

I am using VS 2015, Nuget Package Manager for VS 3.4.4.1321, and accessing the packages via ProGet.

Is this a known issue? Is this the way it should work? Seems like a bug somewhere to me.

Dave Ziegler
  • 1,737
  • 3
  • 19
  • 36
  • I'm not sure if it's a known issue or not. But the ugly workaround might be to find the package on NuGet.org and add find the old version numbers, and then add a reference manually to the packages.config. – Steve Kennedy Mar 10 '17 at 16:38
  • What version of ProGet are you running? There was recently a change in v4.7.4 that removed filtering by target framework, so if you have a version older than that, upgrading should resolve the issue. – John Rasch Mar 10 '17 at 16:52
  • ProGet 4.6.6 so we will try the upgrade and see what happens. – Dave Ziegler Mar 10 '17 at 18:09
  • What about this issue after upgrade ProGet to v4.7.4? Would you please let me know the latest information about this issue? Thanks. – Leo Liu Mar 13 '17 at 04:20
  • After the upgrade, we can now see all packages again. However, the package manager is allowing us to add a package for a higher framework version than the project with no warnings or complaints. The package is added targeting the lower framework but no reference is added. Fixed one thing and introduced new quirks :) – Dave Ziegler Mar 14 '17 at 16:06
  • Since this issue is resolved, I suggest you could write your solution as answer which is benefit to other communities who has the same problem. The new quirks is more related to the Proget, you could post a new post or follow up with Proget teams' forum. – Leo Liu Mar 15 '17 at 11:17
  • We believe the issue resides in the NuGet Package Manager VS extension, isn't that what is responsible for adding references and modifying packages.config? – Dave Ziegler Mar 15 '17 at 14:38
  • So you want to install a nuget package which target to 4.6.1 into the project which target to 4.5.1? – Eddie Chen - MSFT Mar 17 '17 at 06:44
  • Nah, I would expect a warning or something besides adding the package and silently skirting the fact a reference was not really added. Why mess with packages.config if the ref cannot be added? Just my opinion. – Dave Ziegler Mar 17 '17 at 16:04

1 Answers1

0

For others, the resolution in our case was an upgrade of ProGet. This cleared up the original issue, but be aware that VS Package Manager will allow you to add a package targeting an unusable framework, but will not actually add an assembly reference. It just modifies packages.config.

Dave Ziegler
  • 1,737
  • 3
  • 19
  • 36