您现在的位置是:首页>LinuxLinux
Centos ASP.NET Core环境安装
刘海林2022-06-24【Linux】605人已围观
简介Centos ASP.NET Core环境安装
Centos7 ASP.NET Core环境安装
1、安装基础依赖环境
yum install -y krb5-libs libicu openssl-libs zlib libgdiplus
2、到微软官网下载二进制包
#https://dotnet.microsoft.com/zh-cn/download/dotnet/3.1
wget https://download.visualstudio.microsoft.com/download/pr/6f72adf7-0e78-48ea-85ef-e72a39a1f8a1/1ec0238c236c3757e5628563a329fdc4/aspnetcore-runtime-3.1.26-linux-x64.tar.gz
3、解压 ASP.NET Core二进制包到指定路径下
tar -zxf aspnetcore-*-linux-x64.tar.gz -C /usr/local/dotnet/
4、配置环境变量使其生效
cat >> /etc/profile <<'EOF'
# Add .NET Core SDK tools
export DOTNET_ROOT=/usr/local/dotnet
export PATH="$PATH:/root/.dotnet/tools"
EOF
. /etc/profile