이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Getting started with .NET 9.0 on RHEL 8


.NET 9.0

Installing and running .NET 9.0 on RHEL 8

Red Hat Customer Content Services

Abstract

This guide describes how to install and run .NET 9.0 on RHEL 8.

Providing feedback on Red Hat documentation

We appreciate your feedback on our documentation. Let us know how we can improve it.

Submitting feedback through Jira (account required)

  1. Log in to the Jira website.
  2. Click Create in the top navigation bar
  3. Enter a descriptive title in the Summary field.
  4. Enter your suggestion for improvement in the Description field. Include links to the relevant parts of the documentation.
  5. Click Create at the bottom of the dialogue.

Chapter 1. Introducing .NET 9.0

.NET is a general-purpose development platform featuring automatic memory management and modern programming languages. Using .NET, you can build high-quality applications efficiently. .NET is available on Red Hat Enterprise Linux (RHEL) and OpenShift Container Platform through certified containers.

.NET offers the following features:

  • The ability to follow a microservices-based approach, where some components are built with .NET and others with Java, but all can run on a common, supported platform on RHEL and OpenShift Container Platform.
  • The capacity to more easily develop new .NET workloads on Microsoft Windows. You can deploy and run your applications on either RHEL or Windows Server.
  • A heterogeneous data center, where the underlying infrastructure is capable of running .NET applications without having to rely solely on Windows Server.

Chapter 2. Installing .NET 9.0

.NET 9.0 is included in the AppStream repositories for RHEL 8. The AppStream repositories are enabled by default on RHEL 8 systems.

You can install the .NET 9.0 runtime with the latest 9.0 Software Development Kit (SDK). When a newer SDK becomes available for .NET 9.0, you can install it by running sudo dnf install.

Prerequisites

Procedure

  • Install .NET 9.0 and all of its dependencies:

    $ sudo dnf install dotnet-sdk-9.0 -y
    Copy to Clipboard Toggle word wrap

Verification

  • Verify the installation:

    $ dotnet --info
    Copy to Clipboard Toggle word wrap

    The output returns the relevant information about the .NET installation and the environment.

Chapter 3. Creating an application using .NET 9.0

Learn how to create a C# "Hello World" application.

Procedure

  1. Create a new Console application in a directory called my-app:

    $ dotnet new console --output my-app
    Copy to Clipboard Toggle word wrap
  2. Run the project:

    $ dotnet run --project my-app
    Copy to Clipboard Toggle word wrap

    The output returns:

    Hello World!
    Copy to Clipboard Toggle word wrap

Chapter 4. Publishing applications with .NET 9.0

.NET 9.0 applications can be published to use a shared system-wide version of .NET or to include .NET.

The following methods exist for publishing .NET 9.0 applications:

  • Self-contained deployment (SCD) - The application includes .NET. This method uses a runtime built by Microsoft.
  • Framework-dependent deployment (FDD) - The application uses a shared system-wide version of .NET.
Note

When publishing an application for RHEL, Red Hat recommends using FDD, because it ensures that the application is using an up-to-date version of .NET, built by Red Hat, that uses a set of native dependencies.

Prerequisites

4.1. Publishing .NET applications

The following procedure outlines how to publish a framework-dependent application.

Procedure

  1. Publish the framework-dependent application:

    $ dotnet publish my-app -f net9.0
    Copy to Clipboard Toggle word wrap

    Replace my-app with the name of the application you want to publish.

  2. Optional: If the application is for RHEL only, trim out the dependencies needed for other platforms:

    $ dotnet publish my-app -f net9.0 -r rhel.8-architecture --self-contained false
    Copy to Clipboard Toggle word wrap
    • Replace architecture based on the platform you are using:

      • For Intel: x64
      • For IBM Z and LinuxONE: s390x
      • For 64-bit Arm: arm64
      • For IBM Power: ppc64le

Chapter 5. Running .NET 9.0 applications in containers

Use the ubi8/dotnet-90-runtime image to run a .NET application inside a Linux container.

The following example uses Podman.

Procedure

  1. Create a new MVC project in a directory called mvc_runtime_example:

    $ dotnet new mvc --output mvc_runtime_example
    Copy to Clipboard Toggle word wrap
  2. Publish the project:

    $ dotnet publish mvc_runtime_example -f net9.0 /p:PublishProfile=DefaultContainer /p:ContainerBaseImage=registry.access.redhat.com/ubi8/dotnet-90-runtime:latest
    Copy to Clipboard Toggle word wrap
  3. Run your image:

    $ podman run -rm -p8080:8080 mvc_runtime_example
    Copy to Clipboard Toggle word wrap
  4. View the application running in the container:

    $ xdg-open http://127.0.0.1:8080
    Copy to Clipboard Toggle word wrap

Chapter 6. Migration from previous versions of .NET

6.1. Migration from previous versions of .NET

Microsoft provides instructions for migrating from most previous versions of .NET Core.

If you are using a version of .NET that is no longer supported or want to migrate to a newer .NET version to expand functionality, see the following articles:

Note

If migrating from .NET Core 1.x to 2.0, see the first few related sections in Migrate from ASP.NET Core 1.x to 2.0. These sections provide guidance that is appropriate for a .NET Core 1.x to 2.0 migration path.

6.2. Porting from .NET Framework

Refer to the following Microsoft articles when migrating from .NET Framework:

Several technologies and APIs present in the .NET Framework are not available in .NET Core and .NET. If your application or library requires these APIs, consider finding alternatives or continue using the .NET Framework. .NET Core and .NET do not support the following technologies and APIs:

  • Desktop applications, for example, Windows Forms and Windows Presentation Foundation (WPF)
  • Windows Communication Foundation (WCF) servers (WCF clients are supported)
  • .NET remoting

Additionally, several .NET APIs can only be used in Microsoft Windows environments. The following list shows examples of these Windows-specific APIs:

  • Microsoft.Win32.Registry
  • System.AppDomains
  • System.Security.Principal.Windows
Important

Several APIs that are not supported in the default version of .NET may be available from the Microsoft.Windows.Compatibility NuGet package. Be careful when using this NuGet package. Some of the APIs provided (such as Microsoft.Win32.Registry) only work on Windows, making your application incompatible with Red Hat Enterprise Linux.

Legal Notice

Copyright © 2021 Red Hat, inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
IBM® and IBM Z® are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동