BUG: Deleted last nuget reference from C# solution, and it didn't fully remove itself and build was broken

Topics: Ecosystem, General
Dec 10, 2014 at 6:48 PM
I searched and didn't see a report of this, so I'll report it here.

I had a reference in a solution for one project called Sharpavi. When I removed that nuget package, it should have completely removed NuGet from the solution and project. It mostly did, but left a remnant at the very bottom of the project file that made it not compile until we manually edited the project file in notepad and removed the block of code. It looks something like this:

<Import Project="$(SolutionDir).nuget\NuGet.targets" Condition="Exists.....
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore....
Jan 22, 2015 at 4:45 PM
I found that if you load a solution that contains the files .nuget/nuget.targets then nuget in visual studio will automatically add this bit to your project files.
Maybe that helps.