Creating Your First .NET Program on Red Hat Enterprise Linux

Sometimes things are really easy. This is one of those cases. There are only six steps to creating and running your first .NET program on Red Hat Enterprise Linux (RHEL).

Install dotnet

What’s that? You don’t have RHEL installed on your Windows PC in a Virtual Machine (VM). That’s okay … I’ll wait while you install it. Just follow this video to download and install the Red Hat Development Suite.

Okay, now that you have a VM, open PowerShell and run vagrant up to start the VM. When that’s all finished (a few minutes), run vagrant ssh to ssh into the VM.

Now that you’re at the RHEL command line, simply following the six steps in this video to install .NET Core on your VM.

Create a directory

VM up and running: Check.

SSH’d into your VM: Check.

.NET Core installed: Check.

Create a directory for your Hello World! program using the command mkdir hw.

Move into directory

Use the command cd hw.

dotnet new

Use the command dotnet new.

(If that doesn’t work, it’s probably because you have a newer version of .NET Core. In that case, try dotnet new con.)

dotnet restore

Use the command dotnet restore. This pulls the required dependencies from NuGet.org.

dotnet run

Finally, run the program using dotnet run.

Finished!

Congratulations! You created your first .NET Core program on Linux. If you want to do more, start experimenting with the command dotnet –help.

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

 


Developers can now get a no-cost Red Hat Enterprise Linux® Developer Suite subscription for development purposes by registering and downloading through developers.redhat.com.

Share