Unable to restore packages with .targets files.
Steps to reproduce:
1) Create Portable Class Library Project.
2) nuget-install Microsoft.Bcl.Async (for example)
3) Enable NuGet package restore
4) Close solution and cleanup packages folder
5) Try to rebuild project. Build fails with message like:
[project].csproj : error : The imported project "[path]\packages\Microsoft.Bcl.Build.1.0.0-rc\tools\Microsoft.Bcl.Build.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Comments: Yes, this is still an issue. NuGet doesn't do anything automatically for ensuring targets files referenced by packages via PowerShell are retained on disk. If the package utilizes the new MSBuild imports feature through the \build folder, NuGet imports the targets file in a way that allows the package restore build to succeed, but then a 2nd build is needed for a completely successful build. We are still working on some package restore improvements for NuGet 2.7 where we hope many workflows will be improved, with this scenario as one of them.
Steps to reproduce:
1) Create Portable Class Library Project.
2) nuget-install Microsoft.Bcl.Async (for example)
3) Enable NuGet package restore
4) Close solution and cleanup packages folder
5) Try to rebuild project. Build fails with message like:
[project].csproj : error : The imported project "[path]\packages\Microsoft.Bcl.Build.1.0.0-rc\tools\Microsoft.Bcl.Build.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Comments: Yes, this is still an issue. NuGet doesn't do anything automatically for ensuring targets files referenced by packages via PowerShell are retained on disk. If the package utilizes the new MSBuild imports feature through the \build folder, NuGet imports the targets file in a way that allows the package restore build to succeed, but then a 2nd build is needed for a completely successful build. We are still working on some package restore improvements for NuGet 2.7 where we hope many workflows will be improved, with this scenario as one of them.