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