unbuntu(18.04)下体验dotnet core
Posted zlgan
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了unbuntu(18.04)下体验dotnet core相关的知识,希望对你有一定的参考价值。
一、切换阿里云的源
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
以上是关于unbuntu(18.04)下体验dotnet core的主要内容,如果未能解决你的问题,请参考以下文章
Unbuntu18.04通过apt源方式安装mysql5.7.22