unbuntu(18.04)下体验dotnet core

匿名 (未验证) 提交于 2019-12-03 00:13:02

一、切换阿里云的源

1.查看unbuntu版本 

 

 2.备份 /etc/apt/sources.list 并将此文件的内容替换为

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse  deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse  deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse  deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse  deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

最新情况了解:https://opsx.alibaba.com/guide?lang=zh-CN&document=69a2341e-801e-11e8-8b5a-00163e04cdbb

3.更新软件列表:

sudo apt-get update

二、安装DotNetCore SDK

1.在此之前先要注册微软的密钥和产品库,以及安装所需的依赖

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb

2.更新包并安装sdk

sudo add-apt-repository universe sudo apt-get update sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install dotnet-sdk-3.0

3.运行dotnet工具,检查是否安装成功

 

三、第一个  asp.net core mvc程序

1.创建hellmvc目录,并使用模板创建应用程序

 

 

 

 2.发布

 

 3.运行,进入publish目录运行以下命令,服务已经开始在5000和5001端口监听

 

 4.打开浏览器输入:http://localhost:5000

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!