centos 部署 .net core runtime 环境

除非在linux下开发才安装SDK,一般生产环境只需安装 runtime

1、添加 yum 源

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

sudo sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl= https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'

2、安装 .net core runtime 和 asp.net core runtime

yum install dotnet-runtime-2.0.5.x86_64

yum install aspnetcore-store-2.0.5.x86_64

3、运行 .net core 程序,Test目录下有:Test.deps.json、Test.dll、Test.pdb、Test.runtimeconfig.json  .json配置文件不可少

cd Test

dotnet Test.dll

若提示:Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support

则需要安装icu:yum install icu

转载于:https://www.cnblogs.com/eval/p/8280872.html

你可能感兴趣的:(centos 部署 .net core runtime 环境)