标签:
环境:
1、centos7
2、dotnet core 1.0.0-preview1-002702
步骤:
1、安装环境,指定安装目录为~/dotnet
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
2、创建软连接
sudo ln -s ~/dotnet/dotnet /usr/local/bin
3、创建项目
# 创建文件夹 mkdir hwapp # 进入文件夹 cd hwapp #创建项目 dotnet new
4、还原nuget依赖,编译和运行项目
#还原nuget依赖
dotnet restore
# 编译和运行
dotnet run
5、运行结果
[root@localhost hwapp]# dotnet run Project hwapp (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing Compiling hwapp for .NETCoreApp,Version=v1.0 Compilation succeeded. 0 Warning(s) 0 Error(s) Time elapsed 00:00:04.9785477 Hello World!
参考:
https://www.microsoft.com/net/core#centos
【NetCore入门】centos7.x下搭建netcore环境和helloworld的demo
标签:
原文地址:http://www.cnblogs.com/hager/p/5519485.html