active-directory-dotnet-graphapi-console
active-directory-dotnet-graphapi-console copied to clipboard
Can't restore NuGets - NuGet packages missing
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
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')" />
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 ?
Works ... Thank You
Worked like a charm!
- Unload Project
- Edit
.csproj in Visual Studio and remove ALL the lines specified above - Reload Project