下载安装

巨硬官网 - https://dotnet.microsoft.com/zh-cn/download/dotnet
环境很简单,根据需要选择版本;SDK 很大,如果不需要在 Linux 上开发,只需要安装运行时即可

1
2
3
4
5
rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
yum update
yum -y install dotnet-runtime-3.1
yum -y install dotnet-sdk-3.1
yum -y install aspnetcore-runtime-3.1

版本区分

注意:aspnetcoredotnet 是两个东西
/usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.23

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
dotnet --info
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download

Host (useful for support):
Version: 3.1.23
Commit: 7af614fde0

.NET Core SDKs installed:
No SDKs were found.

.NET Core runtimes installed:
Microsoft.NETCore.App 3.1.23 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

相关命令

.NET 监听所有 IP

1
dotnet ./publish/Scigo.Utils.HttpApi.dll  --urls=http://*:5000