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
yum install dotnet-runtime-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
运行成功!