Click here to Skip to main content
14,455,745 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi my pc don't connect to internet.
i download some package of nuget from internet.
but when i install them in console of vs2015, the below errors would appeared:

Install-Package : The current environment doesn't have a solution open.
At line:1 char:16
+ Install-Package <<<< bootstrap -Version 4.3.1
+ CategoryInfo : InvalidOperation: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PackageManagement.Powe rShellCmdlets.InstallPackageCommand


Install-Package : Project 'Default' is not found.
At line:1 char:16
+ Install-Package <<<< bootstrap -Version 4.3.1
+ CategoryInfo : ObjectNotFound: (Default:String) [Install-Package], ItemNotFoundException
+ FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.Power ShellCmdlets.InstallPackageCommand


Install-Package : Unable to load the service index for source https://www.nuget.org/api/v2/curated...crosoftdotnet/.
At line:1 char:16
+ Install-Package <<<< bootstrap -Version 4.3.1
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagem ent.PowerShellCmdlets.InstallPackageComman

What I have tried:

i try very times. but i don't receive any result.

.........
Posted
Updated 18-Oct-19 9:05am
Comments
Richard Deeming 18-Oct-19 13:34pm
   
Make sure you've opened the project that needs to reference the packages before you try to install them.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Nuget downloads packages, installs them to the active project in a solution, and adds the references as required. If you have no solution open, aor no current project within a solution, it has nowhere to add the package data to, and nowhere to add references.

Open a solution, run Nuget offline[^] and it should add the references to the current project - the one containing the file you are viewing.

Think about it: not all projects on a machine (much less all solutions!) need all Nuget packages - so you need to be able to specify which projects do - and that's by having it open when you run Nuget.
If you have multiple projects in a solution that all need the packages, you will have to run Nuget separately for each relevant project.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100