0

Whenever I try to install any package from Nuget through Visual Studio 2022 - be it the GUI or package manager console, I can't seem to find a way to get the highest dependency version.

For example: if I add latest version 1.0.152 protobuf-net.Grpc to my project it has a dependency on Grpc.Core.Api >= 2.36.1. The current version for Grpc.Core.Api is 2.46.3...

In the GUI under options I have no option to control dependency version what so ever it seems like the Install-Package cmdlet doesn't obey -DependencyVersion Highest:

Install-Package protobuf-net.Grpc -DependencyVersion Highest

Installing NuGet package protobuf-net.Grpc 1.0.152.
Committing restore...
Successfully installed 'Grpc.Core.Api 2.36.1'
Successfully installed 'Microsoft.NETCore.Platforms 2.1.0'
Successfully installed 'protobuf-net 2.4.6'
Successfully installed 'protobuf-net.Grpc 1.0.152'
Successfully installed 'System.Memory 4.5.3'
Successfully installed 'System.Private.ServiceModel 4.5.3'
Successfully installed 'System.Reflection.DispatchProxy 4.5.0'
Successfully installed 'System.Security.Principal.Windows 4.5.0'
Successfully installed 'System.ServiceModel.Primitives 4.5.3'

How can I force Nuget to install the highest dependencies version?

JohnUbuntu
  • 699
  • 6
  • 19

1 Answers1

0

According to your description here are some suggestion:

First check your project type “-DependencyVersion Highest” only used in packages.config format.

You can see the project type support about two package management formats: Projects.config and PackageReference.

Someone posted a similar issue on github, see the issue here. Hope this help you.

If you want to use “Grpc.Core.Api 2.46.3 “, you can try to delete the bin and obj folder and then go to Tools>Options>Nuget Package Manager>General>Clear All Nuget Caches.

Then you can install Grpc.Core.Api 2.46.3 package before install protobuf-net.Grpc 1.0.152

Jingmiao Xu-MSFT
  • 2,076
  • 1
  • 3
  • 10