Opening project in Visual Studio fails due to nuge

2019-01-21 07:26发布

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?

7条回答
等我变得足够好
2楼-- · 2019-01-21 08:00

This error normally happens when you are trying to open a .csproj directly, not through the solution file, and the .csproj imports the Nuget targets like this:

<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />

In order to solve it, you can either open the .sln and not the .csproj directly...or remove the import line above.

Notice that the mentioned error will only happen when you are using solution wise package restore, which isn't even recommended anymore.

查看更多
登录 后发表回答