curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview1/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version 1.0.0-preview1-002702 --install-dir ~/dotnet
注:在CentOS中要安裝.net core環境須要libunwind和libicu庫,因此要先安裝好這兩個運行庫,不然會報錯:git
dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue
dotnet_install: Error: Unable to locate libicu. Install libicu to continuegithub
yum install libunwind yum install libicu
sudo ln -s ~/dotnet/dotnet /usr/local/bin
到這裏CentOS的.NET Core環境安裝完畢!web
-> 新建一個.Net項目bash
#建立項目文件夾 mkdir myfirstdotnetcoreapp cd myfirstdotnetcoreapp #建立項目 dotnet new #編譯 dotnet restore #運行 dotnet run
運行成功後打印:app
Project myfirstdotnetapp (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
Hello World!curl