Buy Me A Coffee

Hi!

Quick post today. This one is to save me 30 minutes of internet search next time I face this error.

Context:

New .Net Core Console App.

When I build the console app for the 1st time I got this error.

  • Error: NETSDK1004
  • Assets file ‘<Path> \EventConsoleApp01\obj\project.assets.json’ not found.
  • Run a NuGet package restore to generate this file.
  • C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets
visual studio 2019 new dotnet core console error on 1st build, cant find assets json.jpg

It’s a very silly error. However, if you are old school, the standard methods to fix this won’t work.

So the right way to fix this is to open the NuGet Package Manager Console [Tools // Nuget Package Manager / Package Manager Console] and type the command

dotnet restore
visual studio 2019 dotnet restore on nuget package manager console.jpg

Then rebuild the project, and that’s it! The new build will restore all the package, and also install everything necessary for a console app to run

visual studio 2019 project after dotnet restore.jpg

Happy coding!

Greetings @ Toronto

El Bruno

2 responses to “#VS2019 – How to fix the [obj\project.assets.json’ not found] when building a #NetCore project”

  1. Musa Cyprian Kubheka Avatar
    Musa Cyprian Kubheka

    Thank you, you saved me some time

    Like

  2. Samia Sirdar Brown Avatar
    Samia Sirdar Brown

    I still have a problem after installing dotnet sdk 6.0, C:\Program Files\dotnet\sdk\6.0.100-rc.1.21458.32\NuGet.targets(130,5): error : No such host is known. [C:\Users\sami\source\repos\App9\App9.sln. You’re replay is appreciateed.

    Like

Leave a comment

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading