dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.44k stars 10.02k forks source link

NETSDK1004 #14969

Closed VBAndCs closed 5 years ago

VBAndCs commented 5 years ago

VS.NET Community 2019 v. 16.3.4 Why does NETSDK1004 error happens when running a new ASP.NET Core (Razor Pages) project?

Assets file 'C:\Users\MHG\source\repos\ContosoUniversity\ContosoUniversity\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.

Why don't you include this Assets file by default in the project? Or at least, run auto restore in the first run to solve this directly.

Note: the need to download essential NuGet packages is a problem if there is no internet available at the moment. I suggest that VS.NET includes essential NuGet packages cache as a fallback if we are offline. These packages can be updated with VS.NET updates, and when we download more recent packages.

javiercn commented 5 years ago

@VBAndCs Thanks for contacting us.

Auto restore should be the default behavior in Visual Studio. I would check your VS Settings. Search for enable Nuget package restore.

We don't include he project.asssets.json because the resolved package depend on many factors we can't know when we produce the templates and we want the latest patch to be resolved upon restore.

@vijayrkn Do we know if anything broke in 16.3.4 wrt nuget restore?

Pilchie commented 5 years ago

Closing due to lack of response.