.NET Core on Linux

We have been doing some work with .NET Core on Linux and it has been “interesting”. Some great potentials and some missing pieces.

I am curious if anyone here has tried it and what they think.

We’ve recently ported a lot of console applications to net core so we could run them on raspberry pis.

Works really well, but I’m still waiting for windows forms support so we can move over all of our windows forms gui applications to raspberry pi as well. We’ve been using mono so far but that has some disadvantages that we have a hard time working around.

@Gus_Issa .NET Core on a micro ?

No but why would it matter to the user what is runs on?

1 Like

I have used the dot net framework on both the RPI and the PocketBeagle. It’s a bit of drama to set up since the instructions keep changing from version to version but it does work. Also, the application startup is slow. It takes almost 2 seconds to initialize. People have complained about it but so far I haven’t seen them do anything about it.

In the next few weeks, I’m going to try framework 6.0 to see how things have improved.

I’ve been using it extensively in a bunch of Linux settings : Desktop console apps (for automated deployments, managing devtest environments), and in containers both on local machines and in Azure and AWS. I probably have a dozen dotnet cloud containers running at cloud scale.

I’m not sure Forms is coming, but that just because I have not heard of plans for that. Don’t take that as authoritative. All the energy for x-plat UI seems to be going into Maui.

I use dotnet for the development speed it affords me and the ease with which I can pull in cloud scale logging, db, grpc/protobuf, and auditing, but I do also use Python, Go, Swift, and Kotlin where they make sense (“right tool for the right job”). Maui is still a bit half-baked for x-plat GUI work.

I would love to see an easy .NET Core IoT solution come to market. I have no commercial experience in this space but have played around with it for several years. In the early stages it was painful at best trying compile a small application on a Raspberry PI was a rough experience. However, now with handful of new features, ability to compile locally and a remote debugger (that works) it’s a completely reasonable developer experience even on an older Raspberry PI.

Here are the struggles I see with its current state. Just to get a simple build up and going you have to have a solid understand of Linux (or good at googling), the drivers are very hardware constrained and good documentation is limited.

I think it would be great to have a SoM that included an optimized linux distro, a full set of drivers and all the benifits of a nice clean integrated user experience like GHI has today would be fantastic.

Yes - that’s one of the cases where I opt for Go or Rust (and usually Go)
Also, app size for mobile apps. dotnet apps can be orders of magnitude larger than the Swift and Kotlin equivalents. You trade dev effort for space and perf, and it’s not clear to me yet if that yields enough in revenue to offset the extra engineering effort.

Let’s not forget macOS … I’ve long believed that a VSCode TinyCLR dev environment that covers Win, Linux, and MacOS would be a very useful effort, and it’s technically well within reach.

1 Like

The raspberry pi compute module would be a SoM that might fit your description. Toradex, among others, specializes in SoM style linux modules.
As @mcalsyn pointed out, “right tool for the right job”. That is why I like the SitCore SoM’s. Linux has so much overhead for simple projects. I feel TinyCLR fits pretty nicely between simple bare metal designs and full-blown embedded Linux applications.
If we could get cell modem and hub support on USB then TinyCLR will be almost perfect. :wink:

1 Like

With the release of .NET 6 and in particular the PublishTrimmed and PublishReadyToRun flags it felt like a very reasonable startup experience. Not trying to oversell it but I think headway was made.

1 Like

Let me start by saying this is not my primary industry and I’m more of a hobbyist then anything, so I likely have a skewed perspective. :slight_smile:

The one thing I like most about current platform is ease of use. The problem with something like a compute module is I have to deal with and support Linux. What if a SoM existed where the TinyCLR OS was replaced with a light embedded linux based version that is highly optimized. More of a single purpose OS / firmware for only running .NET with networking. Then all we see on top of that is a IoT API space similar to what we see today along with VS and VS code as development tools.

Just another SoM running Linux doesn’t get me very excited and I agree with what we have today is better. I know something like this would have many deep hurdles (if possible at all). Also, the long term cost and supply of the higher end MCU/CPU may be working against us too.

Many people have been building solutions on the RPI module for years now. This is primarily why RPI can’t keep the thing in stock; the industrial users keep buying them out.

I think that is what balenaOS is trying to accomplish using Docker containers. balenaOS - Run Docker containers on embedded IoT devices

They use a very minimum linux kernal with just enough to run Docker. You deploy your app in a container. Your container would have just the necessary files to run .NET Core.

1 Like

try to use DietPi OS instead fully Rpi OS (or Pi with SSD 32/120 GB or with EMMC) and you will be suprises (also theres plent of hardwares too that could run .Net Core such are OrangePi with EMMC,Radxa Zero with EMMC allo those have WiringPI version included)

.Net 6 is the most crossplatform .Net version so far, and works well with Linux. I have created some small console applications to run both in Linux and Windows and they run pretty well. I have run them also in a Rarsberry Pi 4 wind Ubuntu 2.0 installed and run well. .Net Framework and WPF(the UI framework) are not being developed anymore. Even Xamarin (the framework for Android and Apple) will be replaced with .Net 6 and Maui (the new UI framework) this year. Notice that they even dropped the “core” word from the name because it will be framework for all OSs compiling natively. So, in my opinion, it’s got to be good.

There is a Windows IoT version, but .Net 6.0 is the framework for everything. No need for a IoT framework. .Net 6 on Linux is a great option

The UI framework for .Net 6.0 will be released with .Net 7.0 this year and is called Maui. Maui will replace WPF and Xamarin’s UI. Unfortunately, it won’t be compatible with Linux for now. It will come eventually. In the meantime, there is an alternative named Avalonia which is very nice and easy to learn specially if you know WPF