Install a package inside Nuget is raising this error "NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand"


I have installed a new visual studio community 2022 on a new machine, and I chose to install the azure development packages. Now I opened an existing project which is a .net core 8 azure function (which i developed inside my original machine), inside the new machine, but i got errors on those 3 packages inside the new Visual studio that they cannot be loaded. Here is a screenshot for the packages inside my original machine:-

enter image description here

So i removed those packages and i tried to run this command inside NuGet command line inside the new Visual Studio:-

NuGet\Install-Package PnP.Core -Version 1.15.0

but i got this error:-

NuGet\Install-Package : Argument cannot be null or empty Parameter
name: primarySources At line:1 char:1 + NuGet\Install-Package PnP.Core
-Version 1.15.0 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception +
FullyQualifiedErrorId :
NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:00:00.2039938

also the package source is showing "Microsoft Visual Studio offline", while on other machines I have this set to All, here what i get inside the new visual studio:-

enter image description here

any advice why I am unable to run NuGet commands inside the new visual studio inside my new machine?

Leave a Reply

Your email address will not be published. Required fields are marked *