昨天在github上dnx的一個issue中看到這樣一段話:
we're retiring dnx/dnu/dnvm toolchain and will move to dotnet CLI in RC2.
才知道dnx即將退役,取而代之的是donet cli,難怪最近github上dnx沒有git commits呢。
立馬直奔donet cli的github主頁,在readme中看到了 http://dotnet.github.io/getting-started/ ,于是根據getting started在linux ubuntu上安裝dotnet cli快速體驗了一下。
安裝命令如下:
sudo sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet
沒有了dnvm的身影,直接用apt-get安裝,與linux有了更好的融合。
創建并運行一個hello world程序試試:
mkdir hello-world && cd $_
dotnet new
dotnet restore
dotnet run
運行結果:
Hello World!
之前運行程序用dnx,安裝包包用dnu,現在統一用dotnet命令,這樣的節奏更對頭了。
接著在網上找了找資料,更多了解dotnet cli。
首先找到了 What is the difference between DNX and CLI?
To a large degree, we're just re-factoring DNX as opposed to 'replacing it' outright.
接著發現了 Intro to .NET Core CLI
.NET Core includes three new components: a set of standalone command-line (CLI) tools, a shared framework and a set of runtime services. These components will replace DNX and are essentially DNX split in three parts.
...
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.
再接著尋到了 Exploring the new .NET "dotnet" Command Line Interface (CLI)
My thinking has always been that when a new person sits down to learn node, python, ruby, golang, whatever, for the most part their experience is something like this. It should be just as easy - or easier - to use .NET.
感言
在RC階段(目前.NET Core RC2)竟然發生如此大的變化,出乎人的意料,讓人有種恨鐵不成鋼的感覺,也讓人體會到了.NET在跨平臺過程中的折騰、矛盾、徘徊。但是從結果來看,dotnet cli的確比dnx更對路,從中也可以看出.NET不僅僅是在為了跨平臺而”跨“平臺,而是在跨平臺的過程中不斷完善自己。
文章列表