Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Create Your First .NET Program on Red Hat Enterprise Linux

DZone's Guide to

How to Create Your First .NET Program on Red Hat Enterprise Linux

Learn how to use Vagrant to develop for .NET core on Red Hat Linux and create your first .NET program on RHEL in just 6 steps.

· Integration Zone
Free Resource

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

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.

OK, now that you have a VM, open PowerShell and run vagrant up to start the VM. When that’s all finished (it'll just take 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.

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

Topics:
dotnet ,integration ,rhel ,tutorial ,vagrant ,.net

Published at DZone with permission of Don Schenck, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}