16

I got an error

NuGet package restore failed. Please see Error List window for detailed warnings and errors.

while building my solution. Package manager can't restore my 2 projects:

Unable to find project information for 'C:\(...)\MultiLinker.Courier.Dext.Model.csproj'. The project file may be invalid or missing targets required for restore.

In tools I allow package manage to download packages:

enter image description here

TylerH
  • 20,799
  • 66
  • 75
  • 101
paprykarz
  • 253
  • 1
  • 2
  • 15
  • In the Solution Explorer - Do you see a project by name "MultiLinker.Courier.Dext.Model.csproj" - Is it in Unloaded state? Seems like that project is broken. – Prateek Shrivastava Sep 19 '18 at 07:56

9 Answers9

34

Ran into the same issue. In my case, it was because Visual Studio only had the Offline Package source and could not resolve the packages I needed. I added in the nuget.org source as shown below in the NuGet Package Manager settings and right clicked on the solution and selected restore packages. and it resolved the issue.

screen cap

Bernesto
  • 1,368
  • 17
  • 19
11

open Nuget Package Manager -> Package Source > Add https://nuget.org/api/v2

gandev
  • 131
  • 1
  • 7
3

In my case it was my Company DevOps credentials being out of date

Account Settings > Change credentials in the dialog that opens

Kylar182
  • 79
  • 1
  • 7
2

I might be forgetting some steps, but a crucial step for me to fix this was running nuget restore from the commandline (Trying to restore from Visual Studio UI was not sufficient for some reason).

I also added a plugins folder given to me by a teammate to my .nuget folder that supposedly makes it handle our credentials automatically, so if you are having this issue maybe that is something you are missing as well.

ORcoder
  • 252
  • 2
  • 11
2

On Visual Studio Code (VSCode) this can be solved this way:

dotnet new nugetconfig
Néstor Waldyd
  • 924
  • 7
  • 6
  • I kept getting some cached nuget sources trying to restore and this was the only thing that prevented them from doing so. Thanks! – Taylor Liss Aug 29 '23 at 02:49
0

thank you it works fine and solved all issues of nuget by creating the new value in the setting of nuget under tools > nuget package manger > package manger settings nuget package sources add new value nuget.org and https://www.nuget.org/api/v2/

then save and update you project it will work

0

Before anything, I use Visual Studio 2013.

This worked for me:

  1. Click on Tools > Library Package Manager > Package Manager Console
  2. Paste the following lines on the console: [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bOR [Net.SecurityProtocolType]::Tls12

Then, rebuild your solution.

Rau18
  • 13
  • 5
-1

The nuget restore did not work for me but once I used nuget.org it worked just fine. This was the best solution for me.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 15 '21 at 06:28
-2

Upgrading my out of date Visual Studio helped for me:

Help Menu: Check for Updates...

bhlowe
  • 418
  • 4
  • 8