一、切换阿里云的源
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
原文地址:https://www.cnblogs.com/zlgan/p/11631081.html
时间: 2024-10-01 05:26:54