Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening project in Visual Studio fails due to nuget.targets not found error

So I downloaded Twitterizer from http://www.twitterizer.net/downloads/

I try to open it in Visual Studio and get all these nuget errors:

The imported project "C:\Twitterizer\.nuget\nuget.targets" was not found.  Confirm that the path in the <Import> declaration is correct, and that the file  exists on disk. 

What is going on. How do I deal with this?

like image 529
Barka Avatar asked Feb 03 '12 18:02

Barka


People also ask

How do I fix a NuGet package error?

Quick solution for Visual Studio usersSelect the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.

How do I force a NuGet package to Install?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.


2 Answers

  1. Install Nuget.
  2. Right click on the solution and select "Enable NuGet Package Restore". In Visual Studio 2013 and later, select "Restore NuGet Packages" instead.
  3. Click Ok on the warning.
  4. Close and re-open the solution.

Should now be hunky-dory.

like image 173
Frank Hagenson Avatar answered Sep 22 '22 00:09

Frank Hagenson


An alternative is to edit the .csproj file with a texteditor and remove or comment out the segment.

like image 26
MeanGreen Avatar answered Sep 21 '22 00:09

MeanGreen