Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget 'PackageReference' not installing higher version of available packages #7430

Closed
Rajkumar-Uppala opened this issue Oct 23, 2018 · 17 comments
Labels
Functionality:VisualStudioUI Resolution:Duplicate This issue appears to be a Duplicate of another issue Style:PackageReference

Comments

@Rajkumar-Uppala
Copy link

We have started exploring the option of 'PackageReference' concept to our project.

Earlier we used 'Packages.config' to refer and install the required packages. which used to work fine.

Issue we are facing here with 'PackageReference':

Consider an example say i have a Custom Nuget Package with multiple versions in the repository
MyPackage.1.0.0.0
MyPackage.1.0.0.1
MyPackage.1.0.0.2
MyPackage.2.0.0.0
MyPackage.2.0.0.1
MyPackage.2.0.0.2
MyPackage.3.0.0.0
MyPackage.3.0.0.1
BasePackage.1.0.0.0
BasePackage.2.0.0.0

1)if i create a new console project and trying to install, it is taking a lower(MyPackage.1.0.0.0) or mid range version of package instead of available highest version of package(MyPackage.3.0.0.1)
2)if 'MyPackage' has a dependency on 'BasePackage', here also it is not correctly installing the latest available version (BasePackage.2.0.0.0)

I am not sure what i am missing to configure.

Could you please guide me how to solve these issues.

Details:
dotnet --4.5.2 version
VS version - VS2017 15.8.7
OS version - Windows7

@nkolev92
Copy link
Member

Can you please clarify how are you trying to install it?
Repro steps?

Also by dotnet we emant the dotnet.exe, not the .NET Framework version you are using.

@nkolev92 nkolev92 added Style:PackageReference WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Oct 23, 2018
@Rajkumar-Uppala
Copy link
Author

Hi nkolev92,

We are trying to install the required packages using the NuGetPackageManager from the VS2017 with the settings Packagereference as default selection.

Please let me know if i can provide you any other details on this.

Thanks,
Rajkumar.

@nkolev92
Copy link
Member

Are you using the UI?
In the UI you select which exact version you want to install.

Can you give a step-by-step description of what you are doing, what your expectations are and what actually happens.

@Rajkumar-Uppala
Copy link
Author

I will try to document it, mean while can you please comment on below issue what we are facing very frequently

Different things are happening here very frequently, not sure what is the root cause.
I would like to bring this discussion in conjunction to current thread

We are facing an issue during installing a package using 'PackageReference' only and not with 'Packages.config', though the required package with latest version is available in the feed.
Any comments on this?
NU1101: Unable to find package MyPackage. No packages exist with this id in source(s): MyNuGetFeed

@nkolev92
Copy link
Member

Not sure what exactly your scenario is, but considering we haven't had any similar reports, I'd imagine it's as simple as you trying to install a package that doesn't exist in that feed as the error suggests.

@Rajkumar-Uppala
Copy link
Author

It seems to be bit difficult to explain via documentation here for you to explain my issues.
can we take a meeting via ciscowebex? or something . so that it will be easy for us to understand the issues and go for further steps to resolve them.

Please advise

@Rajkumar-Uppala
Copy link
Author

Rajkumar-Uppala commented Oct 24, 2018

@nkolev92
For more information ,Please find the below log out of the action using PackageReference.
Please advise what else i can provide you on this.

Restoring packages for C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\ConsoleApp5\ConsoleApp5.csproj...
GET http:///nuget/FindPackagesById()?id='MyPackage'&semVerLevel=2.0.0
OK http:///nuget/FindPackagesById()?id='MyPackage'&semVerLevel=2.0.0 537ms
NU1101: Unable to find package MyPackage. No packages exist with this id in source(s): MyNuGetFeed
Package restore failed. Rolling back package changes for 'ConsoleApp5'.
Time Elapsed: 00:00:03.5343329
========== Finished ==========

@Rajkumar-Uppala
Copy link
Author

@nkolev92
If i am trying to install the package using the Packages.config we have below log
I am trying to provide as much info i can.

Please let me know if i can provide you any other details on this.

Attempting to gather dependency information for package 'MyPackage.3.0.0.1' with respect to project 'ConsoleApp1', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 248.86 ms
Attempting to resolve dependencies for package 'MyPackage.3.0.0.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'MyPackage.3.0.0.1'
Resolved actions to install package 'MyPackage.3.0.0.1'
Retrieving package 'EnterpriseLibrary.Common 6.0.1304' from 'MyNuGetFeed'.
Retrieving package 'EnterpriseLibrary.Data 6.0.1304' from 'MyNuGetFeed'.
Retrieving package 'EnterpriseLibrary.Logging 6.0.1304' from 'MyNuGetFeed'.
Retrieving package 'EnterpriseLibrary.Logging.Database 6.0.1304' from 'MyNuGetFeed'.
Retrieving package 'PROactiveInfrastructureCore 7.9.1.94' from 'MyNuGetFeed'.
Removed package 'cnLogger.1.9.0.25' from 'packages.config'
Successfully uninstalled 'cnLogger.1.9.0.25' from ConsoleApp1
Removed package 'EnterpriseLibrary.Common.5.0.505' from 'packages.config'
Successfully uninstalled 'EnterpriseLibrary.Common.5.0.505' from ConsoleApp1
Removed package 'EnterpriseLibrary.Data.5.0.505' from 'packages.config'
Successfully uninstalled 'EnterpriseLibrary.Data.5.0.505' from ConsoleApp1
Removed package 'EnterpriseLibrary.Logging.5.0.505.1' from 'packages.config'
OK http://NuGetserver/ng/api/v2/package/proactiveinfrastructurecore/7.9.1.94 168ms
Successfully uninstalled 'EnterpriseLibrary.Logging.5.0.505.1' from ConsoleApp1
Installing PROactiveInfrastructureCore 7.9.1.94.
Removed package 'EnterpriseLibrary.Logging.Database.5.0.505' from 'packages.config'
Successfully uninstalled 'EnterpriseLibrary.Logging.Database.5.0.505' from ConsoleApp1
Adding package 'EnterpriseLibrary.Common.6.0.1304' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'EnterpriseLibrary.Common.6.0.1304' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'EnterpriseLibrary.Common.6.0.1304' to 'packages.config'
Executing script file 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages\EnterpriseLibrary.Common.6.0.1304.0\tools\install.ps1'...
Successfully installed 'EnterpriseLibrary.Common 6.0.1304' to ConsoleApp1
Adding package 'EnterpriseLibrary.Data.6.0.1304' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'EnterpriseLibrary.Data.6.0.1304' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'EnterpriseLibrary.Data.6.0.1304' to 'packages.config'
Executing script file 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages\EnterpriseLibrary.Data.6.0.1304.0\tools\install.ps1'...
Successfully installed 'EnterpriseLibrary.Data 6.0.1304' to ConsoleApp1
Adding package 'EnterpriseLibrary.Logging.6.0.1304' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'EnterpriseLibrary.Logging.6.0.1304' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'EnterpriseLibrary.Logging.6.0.1304' to 'packages.config'
Executing script file 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages\EnterpriseLibrary.Logging.6.0.1304.0\tools\install.ps1'...
Successfully installed 'EnterpriseLibrary.Logging 6.0.1304' to ConsoleApp1
Adding package 'EnterpriseLibrary.Logging.Database.6.0.1304' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'EnterpriseLibrary.Logging.Database.6.0.1304' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'EnterpriseLibrary.Logging.Database.6.0.1304' to 'packages.config'
Executing script file 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages\EnterpriseLibrary.Logging.Database.6.0.1304.0\tools\install.ps1'...
Successfully installed 'EnterpriseLibrary.Logging.Database 6.0.1304' to ConsoleApp1
Adding package 'cnLogger.2.0.0.7' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'cnLogger.2.0.0.7' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'cnLogger.2.0.0.7' to 'packages.config'
Successfully installed 'cnLogger 2.0.0.7' to ConsoleApp1
Adding package 'MyPackage.3.0.0.1' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'MyPackage.3.0.0.1' to folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Added package 'MyPackage.3.0.0.1' to 'packages.config'
Successfully installed 'PROactiveInfrastructureCore 7.9.1.94' to ConsoleApp1
Removing package 'cnLogger.1.9.0.25' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removed package 'cnLogger.1.9.0.25' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removing package 'EnterpriseLibrary.Common.5.0.505' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removed package 'EnterpriseLibrary.Common.5.0.505' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removing package 'EnterpriseLibrary.Data.5.0.505' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removed package 'EnterpriseLibrary.Data.5.0.505' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removing package 'EnterpriseLibrary.Logging.5.0.505.1' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removed package 'EnterpriseLibrary.Logging.5.0.505.1' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removing package 'EnterpriseLibrary.Logging.Database.5.0.505' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Removed package 'EnterpriseLibrary.Logging.Database.5.0.505' from folder 'C:\WORK\practice\NugetPackageRefDemo\ConsoleApp1\packages'
Executing nuget actions took 8.78 sec
Time Elapsed: 00:00:09.4248036
========== Finished ==========

@Rajkumar-Uppala
Copy link
Author

Please advise me if i need to update any nuget versions on my machine

@nkolev92
Copy link
Member

The packages.config logs seem to be doing a lot more than just that simple package.
Furthermore I don't see the logs of that package being downloaded in the packages.config case.

Make sure you are using the exact same sources for that.

I see that you are using a private server, what's the host there? It could be a server side issue as well.

@Rajkumar-Uppala
Copy link
Author

Thanks @nkolev92 for your response.
If you can guide me how to get the logs/required information/settings , i can work on them and provide you enough details on this. so that we can work together and get this issue resolved.

@koasol
Copy link

koasol commented Nov 6, 2018

I'm sorry if I'm hijacking the thread, but the title is the same as I'm experiencing. Let me know if I should start a new issue.

I'm seeing the same as @Rajkumar-Uppala :
A. If referencing the exact version (3.11.0) I get the one I want installed:
image
image

B. When referencing the package in a "semver" way (3.*), it does not pick the highest version, but rather the lowest within the range:
image
image

This might be as expected, but I still don't understand it fully:

  1. Last image: it reference version 3.11.0 (when using 3.*), but it says that 3.0.0 is installed. Which is actually true?
  2. How do I correctly get last package version within major (3.*)?

@Rajkumar-Uppala
Copy link
Author

@koasol - Thanks for including your experience also here.
We will see if someone helps us to advise how to fix this issue

@nkolev92
Copy link
Member

nkolev92 commented Nov 6, 2018

@koasol
What you are experiencing is #3101.
It's merely a bug in the UI.

The dependencies tree has the correct information.
To verify the exact version you have you can always take a look at the assets file.

@Rajkumar-Uppala
Are you experiencing the same problem @koasol?

@Rajkumar-Uppala
Copy link
Author

@nkolev92 Yes something similar to that

@Rajkumar-Uppala
Copy link
Author

@nkolev92 BTW.. how to verify the assests file?.
Could you please guide me on this. I will also verify the same

@nkolev92 nkolev92 added Resolution:Duplicate This issue appears to be a Duplicate of another issue Functionality:VisualStudioUI and removed WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Jan 14, 2019
@nkolev92
Copy link
Member

@Rajkumar-Uppala

The assets file has a targets section which is TFM based. It should be pretty self descriptive.

@nkolev92 nkolev92 closed this as completed Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:VisualStudioUI Resolution:Duplicate This issue appears to be a Duplicate of another issue Style:PackageReference
Projects
None yet
Development

No branches or pull requests

3 participants