.NET 6

I don’t really talk about .NET on this blog, but I am very interested in .NET 6. I used to be a .NET developer and I used to write Windows Form applications, WPF, Windows Service and ASP .NET applications. The reason I have been away from .NET is because the current company I work for mainly uses Linux technology. (I applied for the job because I was very interested in the Linux realm.)

I am interested in .NET 6 (as of 9/13/2021, it is in preview 7) because it has a new feature of multi platform UI. When I develop software in the last few years, I have always cared for multi platform-ness. I tried Electron for the software I developed in WPF but it didn’t click with me because it’s mainly HTML and JavaScript. I should have pursued it but the thing is that I miss C# very much.

I downloaded the .NET 6 installer for macOS and installed it. After the installation, I opened terminal and ran dotnet. Here is the output I got.

I want to make sure I am using .NET 6 preview 7. So I run dotnet --version and I got the following output.

Now I am going to create a sample code. I run dotnet new --list to list the available project type.

I’m going to create a hello world sample code in console application. I run dotnet new console helloworld to create the sample project

Once dotnet new console helloworld is successful, you get a few files like this.

The Program.cs file already has a sample code like below.

// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!"); 

To compile the code, you can run dotnet build in the same directory.

Once the compilation is successful, it creates bin/Debug/net6.0 directories. In net6.0 directory, it generates several compiled files like below.

As shown in the image, helloworld is an executable file, so you can be in net6.0 directory and execute it like ./helloworld But you can go back to 3 directories up and execute it like dotnet run.

According to the help, dotnet run builds and runs the project, so when you make changes to the code, you could just execute dotnet run to test things out.

I will continue to .NET 6 as time permits.

How to Install htop on Oracle Linux 7

I wrote an article on how to install htop on Oracle Linux before. Thanks to Markus, I learned that installing htop is just a matter of enabling a repo on Oracle Linux 8. I have a Oracle Linux 7 host that I use for a customer and I wanted to install htop on it. I tried to look for epel repo in /etc/yum.repos.d/oracle-linux-ol7.repo but I could not find it. So the only option for me is to add the epel repo under /etc/yum.repo.d

I looked for EPEL repo for Oracle Linux 7 and added the following in /etc/yum.repos.d/oracle-epel-ol7.repo

name=Oracle Linux $releasever EPEL Packages for Development ($basearch)

Then run the following command.

sudo yum update
sudo yum install htop

Then, you get to install htop on Oracle Linux 7. 🙂