Andy Crouch - Code, Technology & Obfuscation ...

.Net Core On Arch Linux

Microsoft .Net Logo

Photo: Microsoft

I work a lot with .Net.

When I am writing non .Net code I develop usually in a Linux based environment. I have been around long enough to remember when Linux was a “cancer” in Microsoft’s eyes. I have to admit that I never thought I would see the collaborative stance than Microsoft has adopted. Over the next year, we will be able to build .Net based applications and SQL Sever databases on Linux. Even Azure has Linux based app services due for release soon.

So, all excited, I and a colleague set about building some .Net Core based services. We both were running Antergos (Arch derivative), he was using his Vim environment and I was trying out VS Code.

Before the chants of “Arch is not supported by .Net core” begin - we know! This was an experiment in existing environments.

To setup the development environment you need to install the following two (AUR) packages:

  • dotnet-cli
  • dotnet-sdk

First the good.

No Visual Studio. This is a personal comment but the longer I use Visual Studio the more I do not like it anymore. It’s not that is a bad application, it is because it is a big, bloated, application. It is trying to be too many things. It is slow, error prone and has features I spend time turning off. Most modern text editors have plugins for colour schemes, IntelliSense and code centric features. You can make your editor work as you want by choice rather than having to endure someone else’s idea of how it works.

Visual Studio Code is a promising editor. Given how young it is (in editor years) I found that with a few select plugins I could be productive very quickly. It seems fairly flexible and it was easy to configure the build targets to get up and running.

.Net core has followed the lead of other frameworks. The terminal can now be used to create, configure and manage applications.

$ dotnet new console 
$ dotnet restore 
$ dotnet run

Running the above code in a terminal creates and runs a “hello world” style application. There is excellent documentation here.

The command line tool is quite well thought through. You find you quickly learn the commands for creating applications and adding references. NuGet is present and still one of the better dependency managers I have used.

(As an aside someone recently on Hacker News suggested that they should replace NuGet with npm. I was killing myself with laughter until I realised it was not 1st April!)

Now the bad (Linux General)

You cannot debug on Linux. If you can I sure as hell couldn’t get it to work. All “what do you need a debugger for” jokes aside, every option I tried came up dry. I installed the Rider IDE and loaded up the project and …. nothing. Googling for solutions led to some articles all bemoaning licensing issues. All these articles also promised to have .Net Core debugging is upcoming releases. This is a massive omission.

Now the bad (Arch Specific)

.Net core development on Antergos/Arch right now is a no go.

We worked within our test environment for a couple of weeks. The first of which were fine. Then an update broke SSL compatibility. We had already patched packages to work with a specific SSL version to get a working SQL Server connection. Then another update flat out broke the .Net environment. This was down to a clang update. This was where our test ended. While I love to work in a terminal-based environment I need one that will allow me to be productive. Until Antergos/Arch becomes a supported platform I will continue my .Net Linux journey on a supported distro in a VM/Docker image.