I searched this problem but none of the solutions worked. I have Visual Studio Professional 2015 installed and I am using TFS. My NuGet version is 3.1.6. This problem is happening only in my C# Web API/MVC project.
I am getting the below error:
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props
- I do not have .nuget folder in my solutions.
- I have a packages folder in the solution and when I delete it, it seems like NuGet does rebuild the dependencies but the project still has the above error.
- I tried removing the project from TFS and it didn't fix it.
- Along with the above error, all the references in the project have yellow warning signs and say they are missing.
- When I checked the NuGet Package Manager for the project, everything that is "missing" has a green tick next to it, including Microsoft.Net.Compilers.
- I tried adding a new Web API/MVC project and it faced a similar problem where most references such as Owin were "missing" with the yellow warning sign.
For anyone who stumbles here with the issue I had (some but not all packages being restored on a build server), the final piece of the puzzle for me was adding a NuGet.config in the root of my solution, sibling to the .SLN file as David Ebbo explained here: http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html.
From Ebbo's blog post, the file contents for me are simply
UPDATE:
The NuGet API URL has changed for v3 (current as of Sept 2016). From https://www.nuget.org/
The error message is completely correct. I tried all the tricks and none worked. The project (simple MVC Web App test) moved from Windows 8.1 VS 2015 Community to my new test box on Windows 10. All the latest updates to VS 2015 applied. I could not even install any newer version of the compilers package.
I finally just copied Microsoft.Net.Compilers.1.0.0 from the old project into the new one and it worked. I could then start to update other packages to newer version. Looks like a nuget project upgrade process bug to me.
NOTE: The original project was created in VS 2015 and does not have any legacy nuget methodologies.
Mine worked when I copied packages folder along with solution file and project folder. I just did not copy packages folder from previous place.
I realize this question is old, however I ran into this same situation today and wanted to throw in my 2 cents for anyone recent finding this issue. An ASP MVC project I had manually moved to a subfolder in my solution and then removed and readded to the solution, using Visual Studio 2017, was giving the error mentioned. Moving the "lib" and "packages" folders to the root of the same subfolder as the MVC project fixed my issue.
For me my gitignore file was ignoring my packages folder. The following gitignore line was causing the issue -
Removed and it restored my packages folder. Hope this helps someone else.
Just enable NuGet Package Restore. Right click your solution > choose 'Enable NuGet Package Restore'.
This will create the .nuget folder with NuGet.Config file and fixed my problem.