CentOS 7 安装. Net Core SDK 2.0
2017-12-25 16:14
489 查看
1.安装.Net Core SDK 2.0
1)首先准备好先决条件sudo yum install libunwind libicu(安装libicu依赖)
2)下载.net Core SDK二进制文件
# https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-download.md
在 https://www.microsoft.com/net/download/linux 下载对应版本
wget https://www.microsoft.com/net/download/thank-you/dotnet-sdk-2.1.3-linux-x64-binaries
3)解压
mkdir -p /usr/local/dotnet
tar zxf dotnet-sdk-2.0.0-linux-x64.tar.gz -C /usr/local/dotnet
4)dotnet添加链接文件。
ln -s /usr/local/dotnet/dotnet /usr/local/bin
5)输入 dotnet --info 来查看是否安装成功
2. 初始化代码
初始化一个webapi应用程序样例!1)创建目录
mkdir /hy/hyapp
2)进入目录(重要:所有下面的dotnet命令操作都在此工程目录之下)
cd /hy/hyapp
3)创建webapi工程
dotnet new webapi
3. 运行程序
1)根据工程还原指定的包文件:dotnet restore
2)实际启动程序
dotnet run
3)发布
dotnet publish
4) nuget 增加类库引用(https://www.nuget.org/),以mysql为例子
dotnet add package MySql.Data --version 8.0.8-dmr
4.准备就绪!
dotnet run 之后 .NET core 2.0 就运行在您的机器上! 默认地址:http://localhost:5000更多资料 https://github.com/dotnet/core/
5.需要工具
Visual Studio Code 可以运行在Linux 或 mac 上,并且全面支持.NET Core。下载免费的 Visual Studio Code 并安装从市场下载 C# extension ,以便开始最佳体验。
相关文章推荐
- CentOS 7 安装. Net Core SDK 2.0
- CentOS 7.3/Linux .net core sdk 安装
- ASP.NET Core 2.0 MVC 发布部署--------- linux安装.NET CORE SDK具体操作链接以及擦欧总细节
- dotnet core 2.0在ubuntu下安装失败
- Ubuntu 16.04 离线安装 .net core SDK
- 记一次阿里云Linux服务器安装.net core sdk的问题以及解决方法
- 菜鸟入门【ASP.NET Core】4:在CentOS上安装.NET Core运行时、部署到CentOS
- CentOS 7.1, 7.2 下安装dotnet core
- Linux Ubuntu上手动安装.NET Core SDK
- centos 7 && dotnet core 2.0 && nginx && supervisor
- Linux Ubuntu系统上手动安装.NET Core SDK的方法
- [原]CentOS7.2最小安装环境部署Asp.NET Core笔记
- mac上安装.Net core SDK,并开始第一个C#程序
- .Net Core Linux centos7行—安装nginx,运行静态网站
- 【ASP.NET CORE 2.0】在CentOS上部署ASP.NET CORE 2.0程序【超详细】
- [置顶] Centos环境下搭建Asp.NET Core环境和安装Jexus
- The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 2.0 or lower, or use a version of the .NET SDK that supports .NET Core 2.1.
- gulp-sass安装失败的原因可能是没有.net framework 2.0 SDK或vs2015
- CentOS 7.1下安装dotnet core
- dotnet core 2.0 安装