Click here to Skip to main content
15,746,248 members
Please Sign up or sign in to vote.
1.00/5 (1 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
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.

Updated 18-Oct-19 8:05am
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

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.
Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900