Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dotnet restore getting error with new csproj file, no project.json file

I am starting to develop an ASP.NET Core MVC Web application with yeoman generated project and ran dotnet restore.

It gives me this error:

The folder '/home/hemal/DOTNET/MyFirstApp' does not contain a project to restore.

There is no project.json file but new MyFirstApp.csproj file is there.

How can resolve this?

like image 452
Hemal Avatar asked Feb 11 '17 13:02

Hemal


1 Answers

I ran into this on my Mac too. The problem is that the Yeoman generator (generator-aspnet) has already been upgraded to use the new .csproj project system, which will fail if you have an older version of dotnet installed.

If the output of dotnet --version on your machine is lower than 1.0.0-rc3-004530, that's the source of the error. Install the latest version and try again, it should work fine.

I was able to get it working with the RC3 release (or later) of the dotnet tooling. Note that at the time of writing (February 2017), the official .NET Core downloads page does not have the version you need!

like image 75
Nate Barbettini Avatar answered Oct 03 '22 21:10

Nate Barbettini