14

Today, I was following multiple tutorial to run a C# application on Linux but always got stuck at the command dnu restore which was returning me a not found error. Later on, I found out this page which seems to indicate that the new command is dotnet restore and when I tried it, it worked.

Are the dnu and dnx commands completely replaced?

Also, is there some documentation somewhere about the dotnet commands?

Gudradain
  • 4,653
  • 2
  • 31
  • 40

2 Answers2

13

Is the dotnet command replacing dnu and dnx commands?

Yes. They are introducing new command line toolchain, ASP.NET 5 will transition to the new tools for RC2. This is already in progress. There will be a smooth transition from DNX to these new .NET Core components.

Are the dnu and dnx commands completely replaced?

No. You can use dnu and dnx, if you follow this instruction Installing .NET Core on Linux.

Is there some documentation somewhere about the dotnet commands?

CLI Repo / Intro to .NET Core CLI - v1.0.0

mungflesh
  • 776
  • 11
  • 22
benlong
  • 668
  • 1
  • 7
  • 16
  • 2
    You say that `dotnet` is going to replace `dnu` and `dnx`, yet you say at the same time that they are not going to be replaced completely. Why? To my understanding, `dotnet` offers everything that `dnu` does and is also multiplatform, so why should the `dnu` tool be kept alive? With `dnx` it may be different because that's execution environment tool, not development tool. But `dnu` feels completely obsolete to me now. – Vojtěch Vít Jan 31 '16 at 12:15
  • @VojtěchVít I use the `dnu` command to add packages to a particular project. I don't see anything in the `dotnet` command for package management except for restore. – lkg Mar 15 '16 at 00:52
  • @VojtěchVít: It looks like they are planning dotnet-install-package, after that I couldn't see a real need for dnu. https://github.com/dotnet/cli/issues/76 – lkg Mar 15 '16 at 02:25
1

Here the basic things

1 dnu restore & dnx run works for version 1.0.0-rc1-update2 coreclr x64 (check using dnvm list) and project.json file needs minimum

"compilationOptions": {
"emitEntryPoint": true
},
"frameworks":{
    "dnxcore50":{
        "dependencies": {
            "System.Console":"4.0.0-*"
        }
    }     
}        

2 dotnet restore & dotnet run works for version 1.0.0-rc2-23811 and project.json file needs minimum

"compilationOptions": {
    "emitEntryPoint": true
},
"dependencies": {
    "NETStandard.Library": "1.0.0-rc2-23811"
},
"frameworks": {
    "dnxcore50": { }
}

Along with this need NuGet.config file.

Now, based on How project.json file configured and dnvm active set, you need to use command.

Avi Kenjale
  • 2,414
  • 6
  • 29
  • 46