Red Hat Customer Portal

Skip to main content

Getting Started Guide

.NET Core 1.0

Installing .NET Core on Red Hat Enterprise Linux

Red Hat Customer Content Services

Legal Notice

Copyright © 2016 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, 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 Software Collections 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.
All other trademarks are the property of their respective owners.

Abstract

The .NET Core platform is a general purpose development platform that has several key features many developers find attractive, including automatic memory management and modern programming languages. These features make it easier to build high-quality apps more efficiently. Multiple implementations of .NET are available, based on open .NET Standards that specify the fundamentals of the platform.
This availability allows Windows developers to deploy to Red Hat Enterprise Linux (RHEL) without having to learn RHEL and to expand the reach of workloads to RHEL environments. The goal is to provide a safe introduction to a new environment and culture without risk of exposure. Now users of RHEL and RHEL-based Red Hat products can develop and run .NET Core applications directly on RHEL, including Red Hat Enterprise Linux Atomic Host and OpenShift Enterprise by Red Hat. (RHEL 7 is the only version that supports .NET Core.)

Chapter 1. Install .NET Core 1.0 on Red Hat Enterprise Linux

This Getting Started Guide describes how to install .NET Core 1.0 on Red Hat Enterprise Linux and perform a simple Hello World! script.

  1. Install Red Hat Enterprise Linux using:

  2. Register the machine by following the appropriate steps in Registering, Unregistering, and Reregistering a System in the Red Hat Subscription Management document. You can also register the system with the following command.

    # subscription-manager register
  3. Display a list of all subscriptions that are available for your system and determine the pool ID of a subscription that provides access to the .NET Core repository.

    # subscription-manager list --available

    This command displays its name, unique identifier, expiration date, and other details related to it. The pool ID is listed on a line beginning with Pool Id.

  4. Attach the subscription that provides access to the .NET Core repository. Replace pool_id with the pool ID you determined in the previous step.

    # subscription-manager attach --pool=<appropriate pool ID from the above step>
  5. Verify the list of subscriptions your system has currently attached.

    # subscription-manager list --consumed
  6. Enable the .NET Core channel for Red Hat Enterprise Linux 7. If you are using a Workstation edition of Red Hat Enterprise Linux 7, change -server- to -workstation- in the following command.

    # subscription-manager repos --enable=rhel-7-server-dotnet-rpms
  7. Install the scl tool.

    # yum install scl-utils
  8. Install .NET Core 1.0 and all of its dependencies.

    # yum install rh-dotnetcore10
  9. Enable the rh-dotnetcore10 collection environment.

    $ scl enable rh-dotnetcore10 bash

    This command does not persist; it creates a new shell and the dotnet command is only available within that shell. If you log out, use another shell, or open up a new terminal, the enabling does not carry over. Consider permanently enabling it.

    $ source scl_source enable rh-dotnetcore10
  10. Run the following command to prove the installation succeeded.

    $ dotnet --help
  11. Create the following directory.

    $ mkdir hello-world
  12. Navigate to the following directory.

    $ cd hello-world
  13. Create a new .NET Core project.

    $ dotnet new
  14. Pull the dependencies needed for the .NET Core project.

    $ dotnet restore
  15. Run the .NET Core project.

    $ dotnet run

Report a bug

Chapter 2. Reference Material

Multiple implementations of .NET Core are available, based on open .NET Standards that specify the fundamentals of the platform. See .NET Standards for more information about the standards and the Common Language Infrastructure.

See The Book of Runtime and the CoreFX framework for more information about the various Common Language Runtime libraries and framework.

See Red Hat Enterprise Linux documentation for more information about Red Hat Enterprise Linux 7.

A docker image for .NET Core is available from the Red Hat Registry at dotnet/dotnetcore-10-rhel7.

See Using Red Hat Software Collections Container Images for information about obtaining, configuring, and using container images that are shipped with Red Hat Software Collections.

Report a bug

Appendix A. Revision History

DateVersionAuthorChanges

06/24/2016

1.0

Les Williams

Original version

07/27/2016

1.0

Les Williams

Revised version number to reflect top-level version and spelled out RHEL

08/29/2016

1.0

Les Williams

Removed Step 8 and removed command outputs from Steps 9, 11, 14, 15, and 16

09/23/2016

1.0

Les Williams

Revised the link for Common Language Runtime (CLR) and added a link for Common Language Infrastructure (CLI)

11/7/2016

1.0

Les Williams

Added references to Red Hat Enterprise Linux 7 Workstation and added a link for permanently enabling rh-dotnetcore10 bash

11/15/2016

1.0

Les Williams

Replaced link with the command to permanently enabling rh-dotnetcore10 bash

12/06/2016

1.0

Les Williams

Added RHEL variants to Step 1

Report a bug