Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

A Windows Guy’s Guide: Setting up .NET Core on RHEL

 

June 3, 2016
Andrew Male
Related topics:
.NETLinux
Related products:
Red Hat Enterprise Linux

Share:

    Despite spending plenty of time in Red Hat Linux while I was young, I have become an unabashed Windows environment super-user/programmer. Still, it’s hard to discount the multitude of ways that the *nix community stands ahead and alone, so when Microsoft and Red Hat announced their partnership to bring .NET to Linux, I had no choice but to take notice. As an experiment, I am going to go through setting up Red Hat Enterprise Linux (RHEL) and .NET Core to see if I can’t have a little fun and test the technology before it’s even at its first release.

    This post is the first of two, with the final goal of learning how to convert an existing .NET application to .NET Core. But first we have to set up .NET Core on RHEL. (Also note that RHEL is now available at no cost for developer use! You can download it here.)

    (Tip: if you want to go straight to the answer, skip to the third setup attempt)

    The Goals

    For this first post, the goals were meant to be straightforward:

    • Create a functioning VM on my local machine with RHEL 7.2 and Windows Hyper-V
    • Install Visual Studio Code
    • Install .NET Core
    • Convert a simple .NET project to work on .NET Core
    • Install TeamCity
    • Create a TeamCity Build Job for the .NET project

    Setting up the VM (The First Time)

    Deciding to get straight into it, I found my way to http://developers.redhat.com/ and followed the directions to get started with a Hyper-V install. Lo and behold, everything went swimmingly and I was up and running with a simple RHEL 7.2 VM almost accidentally. After correcting a minor issue with my network switch (I had selected the wrong adapter to pass the connection through, purely my mistake), I was able to easily install Visual Studio Code and got ready to dig into .NET Core.

    .NET Core, RPMs, and Tragedy

    In doing research for this effort, I’d found a post only a couple days old that seemed to cover the beginnings of my effort (I even started to worry I’d chosen a bad topic). Following the links there I downloaded the RPMs and allowed RHEL to install them for me via a series of double-clicks. All seemed well, I ran the scl enable command, and everything worked! Or so it seemed.

    I was able to use the dotnet new and dotnet restore commands, but when I tried calling dotnet run to compile and execute the starter project, a crack appeared in the world. I was presented with a message describing a problem loading the host policy for the version of .NET Core I was attempting to run. I tried many things:

    • Manually adjusting versions in the project.json to match what I appeared to have on disk
    • Replacing the .NET Core binaries with those provided on GitHub
    • Installing multiple versions of the binaries alongside each other

    All attempts proved fruitless, and I took a few minutes to belittle inanimate objects in my apartment as a vent for my (likely unreasonable) rage. It was time to try another tactic.

    Setting up the VM (The Second Time)

    With one set up under my belt, I was feeling more confident. Burr’s post also references pre-built VM’s for Hyper-V and VirtualBox, so it seemed a sure-fire solution to my problems. I erased all my previous work, created a new VM using the supplied vhdx, and settled in to get back to making progress.

    The fates were against me, however, as for some reason (probably due to my own ineptitude), the VM refused to allow me to register the account underneath my Red Hat developer account. I found out that this is a significant problem on Red Hat, as it makes things such as yum inoperable.

    Back to the drawing board.

    Setting up the VM (The Third Time)

    After a motivational talk and some Linux tips from a friend, I tore down the pre-built VM and started again from scratch. This time, however, I remembered that the best way to learn is to do it yourself. I followed the instructions in Don Schenck’s starter container kit, and off I went:

    1. Install RHEL 7.2, as in first attempt (no problems)
    2. Install VS Code (no problems)
    3. wget latest binaries in tar.gz format from GitHub
    4. Install dependencies (libicu, libuuid, libcurl, openssl, and libunwind)
    5. Extract dotnet files into a directory in my home
    6. Add the DOTNET_HOME path to my .bash_profile (reload with source ~/.bash_profile)
    7. Run example project commands (dotnet new, dotnet restore, dotnet run)

    While running the dotnet restore, I ran into a problem where NuGet didn’t seem to know how to resolve any of my project’s dependencies (shown by the message Unable to resolve 'Microsoft.NETCore.App' for '.NETCoreApp,Version=v1.0'.). With some Google/Bing magic, I found an issue on GitHub that recommended I change my NuGet feed list in ~/.nuget/NuGet/NuGet.Config to use feeds from myget.org. Making this change did fix my issue with restoring the project.

    I also ran into a problem again with the referenced version of the Microsoft.NETCore.App dependency for the project (located inside the project.json). I resolved this by changing the value from “1.0.0-rc2-3002446” to the installed version (from Step #3) of “1.0.0-rc2-002446”.

    It was only then that I was able to successfully compile and run the ‘Hello World!’ application that dotnet new creates for you.

    Final Thoughts, And Part 2

    First and foremost, I need to provide a disclaimer:

    All of this work was done with a pre-release version of .NET Core, and it is not an accurate indicator of the final product. The Red Hat official "yum install dotnet" functionality is due any time now and will simplify things greatly.

    It’s an important disclaimer because it means the pain and process I had to go through to get .NET Core (formerly DNX) running are unlikely to be necessary once the project stabilizes with 1.0. I look forward to that release, but for now I certainly relearned a good deal about Linux.

    In Part 2 of this series, I’ll be going over how to convert an existing .NET application to .NET Core as well as setting up TeamCity to build that project automatically. Be sure to sign up for Red Hat Developers to stay in the loop for my next post!

    Resources

    Here is a grab bag of the various things that helped me get this far:

    • .NET Core CLI Release - https://github.com/dotnet/cli#installers-and-binaries
    • Don Schenck’s Starter Project - https://github.com/DonSchenck/DotNetOnLinux
    • Motivational Help from Chris Dougherty - https://twitter.com/ctd1500
    • .NET articles and updates on Red Hat Developers - https://developers.redhat.com/products/dotnet/overview

    For additional information and articles on .NET Core visit our .NET Core web page for more on this topic.


    Screen Shot 2016-05-27 at 4.01.34 PMAndrew Male

    Andrew Male (@AndyM84) is a senior engineer at an enterprise development company in Boston, MA. Andrew has been programming from a young age and is entirely self-taught. He has spent time in many corners of the programming world, including game/VR work, agency work, and teaching development to students and adults alike. He spends most of his time working on architecture design and pursuing his favorite hobby—physics.

    Last updated: March 15, 2023

    Recent Posts

    • Why some agentic AI developers are moving code from Python to Rust

    • Confidential VMs: The core of confidential containers

    • Benchmarking with GuideLLM in air-gapped OpenShift clusters

    • Run Qwen3-Next on vLLM with Red Hat AI: A step-by-step guide

    • How to implement observability with Python and Llama Stack

    What’s up next?

     

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue