Josh Oladele
Josh Oladele

Reputation: 41

dotnet new generates a .csproj file instead of project.json

I am following this documentation https://www.microsoft.com/net/core#macos on how to run .NET Core on mac. I have successfully installed the dotnet command and all but when I try to create a new project using dotnet new, it generates a .csproj file as opposed to project.json as described. This doesn't allow me to go on to run dotnet restore or dotnet run to run this new project. I don't know what I'm missing out here. Kindly assist.

Upvotes: 3

Views: 546

Answers (1)

Josh Oladele
Josh Oladele

Reputation: 41

I found a way around this. I created a project.json file and put the necessary parameters in it. In this case,

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        },
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0"
      },
      "imports": "dnxcore50"
    }
  }
}

Then dotnet restore works there on. Cheers!

Upvotes: 1

Related Questions