Skip to content

Add a document with guidance on how to ship an .NET app or library on Linux #17757

Description

@dagood

Other platforms have guidance docs for how to deploy applications and libraries on Linux, as part of the distro or as a third party app:

.NET [Core] should have something similar.

@omajid looked into these and came up with some ideas:

This isn't something I have looked at in detail. That said, other similar programming languages have a ton of guides/policies we can learn from. Looking at https://fedora-java.github.io/howto/latest/ for a minute, it sounds like we basically need two set of rules: 1. my package is a library (or nuget package) 2. my package is an application

for 1, a distro would set up a common path as a nuget package repository and all (.net based) library rpm-packages should install into it. maybe something like /usr/lib/dotnet-repository/ or some such.

for 2, the application can probably install into /usr/lib/application-name (or, more appropraite for an app not part of the distro: /opt/application-name) and then install a script that does /usr/bin/dotnet /path/to/my/application.dll and copy that into /usr/bin/ (or /usr/local/bin, for app not part of the distro)
and an RPM package would just contain the concrete steps to build and install into one of these locations


Runtime-dependent apps using our packages (https://docs.microsoft.com/en-us/dotnet/core/distribution-packaging#recommended-packages) might be the obvious scenario to document, but it makes sense to give guidance for self-contained deployments as well. E.g. to run on distros that don't have .NET runtimes available as packages.

On the managed library side, there are some more complications:

  • For the build-time dependency, there should be a standard place on disk to place NuGet packages. (We should establish one.) This is necessary when building a package to include in a Linux distribution, because we can't use nuget.org (prebuilts!).
  • At runtime, it's wasteful to include a copy of every managed dependency DLL along with your app. It may be good to recommend deploying to the runtime store (https://docs.microsoft.com/en-us/dotnet/core/deploying/runtime-store) to avoid this.

Originated at https://twitter.com/adanenrique/status/1247701126494990343 🙂 Thanks to Red Hat folks for helping with research and recommendations here.

/cc @richlander @leecow @nakarnam @dleeapho


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions