参考资料 https://learn.microsoft.com/zh-cn/dotnet/core/install/linux-rhel#where-is-centos-linux

 微软好像不持支.net 7所以把demo换成.net8

sudo dnf install dotnet-sdk-8.0

 然后就开始报错,大致意思就是无法解析,找不到地址资源

进入yum的repos目录
cd /etc/yum.repos.d/
修改所有的CentOS文件内容
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

yum clean all

yum makecache

然后

sudo dnf install dotnet-sdk-8.0

 然后就能安装sdk了

 测试的时候把这个地方去掉判断,待会运行demo就能看到swagger

 

把发布的文件传到linxu中去

 

然后运行dll

dotnet WeCharWebApi.dll --urls=http://0.0.0.0:5000

 

 

posted on 2024-07-03 15:13  啊修  阅读(1)  评论(0编辑  收藏  举报