8

I am using Visual Studio Version 8.10.8 (latest) in macOS Big Sur. I have cloned a repository of Asp .Net project. When I try to run the project I get

NuGet packages need to be restored before building. NuGet MSBuild targets are missing and are needed for building. The NuGet MSBuild targets are generated when the NuGet packages are restore

this error.

Screenshot: csproj of main project
Image of error.

Unknown
  • 427
  • 5
  • 9

2 Answers2

7

On your visual studio sidebar, click on the drop down dependencies folder. You will then find the NuGet folder, right click on it then select restore. It should work afterwards.

  • Getting this in a working solution for VS2022/Win if I try to open the it in VS2022-preview/Mac. The solution to right-click **Dependencies** and choose **Restore** worked like a charm. The only reference the "broken" project had was **Microsoft.NETCore.App** - 6.0.5, exactly the .NET version this release of VS2022 brings, so it really looks like an unnecessary step from VS2022. – Avenger May 11 '22 at 23:12
4

Somehow using a VPN solved my Issue.

Ahmed Mustafa
  • 101
  • 1
  • 9