4

In my Visual studio 2015 update 3, I am experiencing bellow error when copied the solution folder to another windows machine.

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 verified the NuGet Package Manager for the project, everything that marked as "missing" has a green tick next to it, including Microsoft.Net.Compilers.

Sree
  • 351
  • 3
  • 9
  • 1
    Possible duplicate of [This project references NuGet package(s) that are missing on this computer](https://stackoverflow.com/questions/22909506/this-project-references-nuget-packages-that-are-missing-on-this-computer) – Maxime Jan 10 '18 at 20:01

1 Answers1

9

solved the issue by removing below mentioned code segment from .csproj file

<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>
Sree
  • 351
  • 3
  • 9
  • Really strange ... hack the target node and all is well. Worked for me. – pat capozzi Nov 22 '18 at 23:07
  • @LeoLiu-MSFT if you see the other question (https://stackoverflow.com/questions/22909506/this-project-references-nuget-packages-that-are-missing-on-this-computer) which has this error, there are many possible causes, it seems. – StayOnTarget Dec 06 '18 at 13:49