Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Can't restore NuGets - NuGet packages missing #43

Open
nrogoff opened this issue Feb 24, 2017 · 4 comments
Open

Can't restore NuGets - NuGet packages missing #43

nrogoff opened this issue Feb 24, 2017 · 4 comments

Comments

@nrogoff
Copy link

nrogoff commented Feb 24, 2017

Can't build solution as checked in. Get following error:

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is D:\GitRepos\active-directory-dotnet-graphapi-console\.nuget\NuGet.targets. GraphConsoleAppV3 D:\GitRepos\active-directory-dotnet-graphapi-console\GraphConsoleAppV3\GraphConsoleAppV3.csproj 94

@nrogoff
Copy link
Author

nrogoff commented Feb 24, 2017

Solution is to remove the following lines from the csproj file (after unloading) and rebuild.

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
 <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
 </PropertyGroup>
 <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />

@kiewic
Copy link

kiewic commented Aug 15, 2017

This fix works great. These lines are obviously not needed for Visual Studio 2015, wondering if they are needed for Visual Studio 2013 O.o ?

@RajivGoaple
Copy link

Works ... Thank You

@natasha-zz
Copy link

natasha-zz commented Nov 9, 2018

Worked like a charm!

  1. Unload Project
  2. Edit .csproj in Visual Studio and remove ALL the lines specified above
  3. Reload Project

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants