Ubuntu16.04下的NetCore环境搭建(附录含Ubuntu 18.04 安装 NetCore2.1)

简介: 跨平台系列汇总:http://www.cnblogs.com/dunitian/p/4822808.html#linux VSCode安装:http://www.cnblogs.com/dunitian/p/6661644.

跨平台系列汇总:http://www.cnblogs.com/dunitian/p/4822808.html#linux

VSCode安装:http://www.cnblogs.com/dunitian/p/6661644.html

搜狗拼音安装:http://www.cnblogs.com/dunitian/p/6662374.html

直接进入附录:https://www.cnblogs.com/dunitian/p/6745562.html#netcore2.1

官方参考链接:

离线下载: https://www.microsoft.com/net/download/linux

.NET Core 命令 https://docs.microsoft.com/zh-cn/dotnet/articles/core/tools/index

1.设置源并更新 https://www.microsoft.com/net/core#linuxubuntu

2.安装SDK

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893

sudo apt-get update

1.创建一个控制台程序 dotnet new console -o xxx

2.用VSCode打开

3.Ctrl+`打开终端

4.第一次打开CS文件会加载一些调试时用的包

5.加载依赖包 dotnet restore,运行程序 dotnet run

6.自动创建的配置文件

7.运行控制台

8.ok了,vscode用起来可能没有VS嗨皮,但是真的比其他编辑器好太多,慢慢习惯吧

9.创建MVC项目 dotnet new mvc -o MyMVC

10.加载依赖包dotnet restore 运行 dotnet run

11.浏览器打开该地址~运行效果

附录:

安装NetCore开发环境:

Ctrl+Alt+T,调出终端,一行一行输入即可

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg

sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/

wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list 

sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install apt-transport-https

sudo apt-get update

#如果只是想运行netcore,那安装运行环境即可:sudo apt-get install dotnet-runtime-2.1
sudo apt-get install dotnet-sdk-2.1  

 参考图片:

 

我pc安装的是运行环境

安装开发环境:https://www.microsoft.com/net/learn/get-started/linux/ubuntu18-04

安装运行环境:https://www.microsoft.com/net/download/linux-package-manager/ubuntu18-04/runtime-2.0.7

作者: 毒逆天
打赏: 18i4JpL6g54yAPAefdtgqwRrZ43YJwAV5z
本文版权归作者和博客园共有。欢迎转载,但必须保留此段声明,且在文章页面明显位置给出原文连接!
目录
相关文章
|
20天前
|
Ubuntu NoSQL 关系型数据库
Ubuntu系统下安装常用软件
Ubuntu系统下安装常用软件
41 0
Ubuntu系统下安装常用软件
|
1月前
|
Ubuntu Linux C语言
Ubuntu下安装vscode,并解决终端打不开vscode的问题
Ubuntu下安装vscode,并解决终端打不开vscode的问题
130 0
|
2月前
|
存储 Ubuntu 网络协议
|
1月前
|
Ubuntu Docker 容器
如何在Ubuntu上安装Docker?
【2月更文挑战第10天】
236 0
|
2月前
|
负载均衡 Ubuntu 应用服务中间件
|
22天前
|
Ubuntu 关系型数据库 MySQL
Ubuntu 中apt 安装MySQL数据库
Ubuntu 中apt 安装MySQL数据库
66 0
|
1天前
|
Ubuntu 数据安全/隐私保护
在UBUNTU虚拟机上安装R软件包
在UBUNTU虚拟机上安装R软件包
|
1天前
|
存储 编解码 Ubuntu
0-零基础安装ubuntu(超详细安装步骤)
0-零基础安装ubuntu(超详细安装步骤)
|
2天前
|
Ubuntu Linux 定位技术
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
|
16天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器