Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 703
Josh Oladele Avatar asked Jan 25 '26 10:01

Josh Oladele


1 Answers

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!

like image 147
Josh Oladele Avatar answered Jan 28 '26 05:01

Josh Oladele



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!