
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

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

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

Happy coding!
Greetings @ Toronto
El Bruno
Thank you, you saved me some time
LikeLike
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.
LikeLike