It is very important to learn what to install on a CentOS if you want to deploy a .NET Core application or set up a development environment there. So here we quickly go over the necessary details.
The actual package we might install is,
dotnet-sdk-2.2if we want a minimal .NET Core development environment.
aspnetcore-runtime-2.2if we want to host an ASP.NET Core app in framework dependent deployment mode.
dotnet-runtime-2.2if we only host a normal console application in framework dependent deployment mode.
From the diagram below we can see the dependency relationship among the RPM packages.
For CentOS 7, we can see three native dependencies (not part of .NET Core) are needed,
- openssl-libs (cryptographic API depends on it)
- krb5-libs (Kerberos support)
If they are missing from the system, .NET Core apps or SDK won’t function properly.
So what do we need if an application is published in self-contained deployment mode?
As the name indicates, .NET Core runtime bits are bundled with the application itself, and we don’t need the SDK or runtime packages in that case.
However, keep in mind that
dotnet publish won’t include the native dependencies (three in CentOS 7 case) so we still need to manually install them,
1 sudo yum install openssl-libs libicu krb5-libs
(though very likely they are already installed while you install CentOS.)
.NET Core installation/deployment on other Linux distributions might require different package names/commands, but I believe the general principles remain the same.
Note that the packages for Red Hat Enterprise Linux 7 are much more complex, compared to CentOS 7. It is too lengthy to go over all the details, so I only attached its diagram,