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

2

7

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?

Cottonmouth answered 11/2, 2017 at 13:37 Comment(4)
what is your dotnet -version? Which template you choose from yeoman generator?Tirza
Dotnet 1.1.0 latest one. I also have new csproj file. Web application without authentication in yeoman.Cottonmouth
check that version is correct if you run dotnet -version from root project folder, as it may be overridden by global.json file.Wildebeest
OK then what should I do?Cottonmouth
C
11

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!

Copter answered 11/2, 2017 at 20:44 Comment(8)
I just installed both yeoman and dotnet on my Mac and it doesn't work either.Supplicatory
@AdamMendoza What is the output of dotnet --version?Copter
I'm getting 1.0.0-preview2-1-003177 Just installed it.Supplicatory
@AdamMendoza That's the current "stable" release, but you'll need RC3 or later to work with csproj. See the link in my answer for the download.Copter
I couldn't install RC3 on my Ubuntu 16.10Cottonmouth
@Cottonmouth If you got an error when installing, post another question or ask on GitHub?Copter
Sure, I have submitted an issue on github. Please see if you can find an answerCottonmouth
I did found a working hack on github with this issue link github.com/dotnet/core/issues/496. Thank you all.Cottonmouth
G
0

The problem is that the latest Yeoman generate need updated version of .NetCore because Yeoman generator creates .csproj file and the latest version support .csproj file. I had this issue on mac and installed latest version of .NetCore and it worked fine for me. You can get latest SKD from link. I installed macOS (x64) PKG.

Goat answered 28/4, 2017 at 12:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.