If you’re using Debian 12 and need to run or develop applications built with .NET Core 3.1, you can easily set up the runtime and SDK environments using Snap. Here’s a step-by-step guide to get you started:

Step 1: Install Snap

Snap is a package management system that makes it easy to install and manage software. First, ensure Snap is installed and enabled on your system:

This installs Snap and ensures that it starts automatically.

Step 2: Install .NET Core 3.1 Runtime

With Snap installed, you can now install the .NET Core 3.1 runtime. Run the following command:

The --classic flag ensures that the runtime has the necessary permissions to function correctly.

Step 3: Install .NET Core 3.1 SDK

To develop applications with .NET Core 3.1, you also need to install the SDK. Use the following command:

The SDK includes tools to create, build, and debug .NET applications.

Step 4: Verify the Installation

Once the runtime and SDK are installed, verify that they are working by listing the installed .NET runtimes and SDKs:

You should see entries for Microsoft.NETCore.App 3.1.x in the runtimes and 3.1.x in the SDKs.

Step 5: Test the Runtime and SDK

To confirm the runtime and SDK are fully functional, create and run a simple .NET application:

  1. Create a Test Directory
  1. Create a New Console Application
  1. Run the Program

If everything is set up correctly, you’ll see:

Important Notes

  1. End of Support:
    .NET Core 3.1 reached its end of support on December 13, 2022. It’s recommended to upgrade to a newer version of .NET if possible.
  2. Snap Isolation:
    Snap installs software in isolated environments. If your application requires additional configuration, ensure it’s compatible with Snap’s sandboxing.
  3. Upgrade Recommendation:
    While .NET Core 3.1 may be sufficient for legacy applications, exploring .NET 6 or later versions can offer long-term support and better performance.

With these steps, you can quickly get your .NET Core 3.1 runtime and SDK environments ready on Debian 12.

Leave A Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.