.NET on Linux – bye, Windows 10.

I’ve eventually decided to start using the *NIX system for the software development.
Being a Windows user and the .NET developer for many years now, it might seem like a radical change, but let me tell you this – it was a great decision and here is the explanation.


 

At first a really short introduction – it was Friday (14th of October) and I was working on something at the office. Then this Windows popup came out of nowhere saying: “You have 20 minutes left, after that period we will install the updates. And you can do nothing about it.”.
It was maybe 15 minutes later and I could see my laptop shutting down already.
Then 2 or 3 updates were installed which took almost an hour, in the middle of the day (and work). So yeah, screw you Windows 10.

Windows 10 "out of nowhere" update.

Windows 10 “out of nowhere” update.

However, it wasn’t a decision that I made purely based on emotions. Honestly, if it wasn’t for the latest project for which I needed a device with the touchscreen (Lenovo Yoga 900 user here) I’d probably bought the Macbook instead. I guess that one day Apple will make a Macbook with touchscreen and call it revolutionary, but that’s another story.
I still have Windows 10 (un)fortunately on my PC due do the fact, that I need to migrate 1 or 2 more projects into the .NET Core. However, on my laptop that I use at work I did totally wipe out anything related to the Microsoft system and installed Linux Mint.
Why Mint? I don’t know, some people on the internet said that if you’re new into the Linux (I do remember some commands, though, good, old times at the university) you should pick this one instead of Ubuntu (no hard feelings bro), so I did.

Before I did manage to install a fresh system on my laptop I had to disable UEFI, create valid partitions with special flags etc. it took me a while to figure this out, yet it wasn’t that difficult.
The installation part was really quick and within a few minutes, I was already able to login to my brand new OS.

Brand new Linux Mint.

Brand new Linux Mint.

First thing I did was to install the .NET Core framework. It was almost that simple as it’s written on this page. Almost, because there was some missing dependency to some .NET Core preview library that couldn’t be resolved so I had to Google it. Once I had my framework running I was finally able to build and run one of my applications. It “worked”. Again, “worked”, because there was one thing that was causing an issue – a reference to the System.Drawing in the project.json.
Although the application did run correctly, it threw an exception that gdiplus.dll could not be found. It makes sense, that’s a Windows component so it’s not available on Linux.
But my point here is that although being the .NET Core application it’d still crash, so imagine what would happen if I’d publish it to some Linux server – everything would seem to work, but actually it wouldn’t. Another point for the .NET Core development on the Linux instead of Windows.

After installing some tools and services such as Git, MongoDB, Redis, Slack, Skype etc. I had to decide how do I want to write the actual code. I’m a big fan of the Visual Studio Code – I’m using this one mostly for the javascript development (and everything not related to the C#), however, I had some doubts about my productivity e.g. without the Resharper.
It turned out that there’s some great extension called OmniSharp(you can also use it with Atom, Brackets, Sublime or even Vim) and it works well with the VS Code. Surely, it’s not a Visual Studio + Resharper, but I can use some most basic as well as important features such as find by file, by method/type, rename, go to definition or display references.
I’ve also tried to use the Project Rider but no luck here. It did load my solution correctly, but there was some internal exception caused by the Resharper built into this IDE and I couldn’t really build my projects (I was able to write the code, but shortcuts didn’t work either).
However, I do believe that once JetBrains fixes most of these bugs it will be the best cross-platform IDE available for the .NET development (can’t wait for it to happen). Last but not least, there’s nothing a simple bash script can not solve in terms of project automation (running, testing and so on).

Visual Studio Code + OmniSharp is the way to go.

Visual Studio Code + OmniSharp is the way to go.

And the last part, which is Docker. So, the story is that I was planning to put my hands on Docker for quite some time now. I did play with it a little bit in the past but couldn’t find a real use for my projects. Yet, the things are different now – since we’ve started developing some of our application using the Microservices + CQRS patterns it seems like a good idea to make use of the Docker images and containers.

And that’s another advantage of using the Linux instead of Windows for the software development process. Linux is a natural environment for the Docker – if it works on my machine I can be sure that it will work on some remote server.
I was able to run the Docker on my Windows 10, but you need to use the HyperV or VirtualBox and when I did try to run a docker build it would throw an error due to some system variable or $PATH which I’d need to take care of only because I’m running the Docker on Windows.
Oh, and I guess I did forget to mention why I wasn’t able to run my aurelia application on Linux – so it was built on Windows and the path endings in aurelia.json file were “\\”. I had to replace them as “/” to make it work on Linux (which of course doesn’t work on Windows).
And well, I’m not even going to mention here how great the *NIX bash is and that setting up the NGINX with SSL certificate, reverse proxy and redirection was so simple.

Running Docker as a natural part of ecosystem.

Running Docker as a natural part of ecosystem.

To sum up – I’m not trying to say that Windows is not so good for the software development. For example, the Visual Studio will be probably hard to beat for many years amongst many other great tools. My point is that if you’re not tied up to some specific technology which is not cross platform (which usually means for the Windows users only), you might want to give a try to some other environment. It’s always a good thing to try out something new, hone skills and broaden your horizons.

88 Comments .NET on Linux – bye, Windows 10.

  1. Pingback: .NET on Linux – bye, Windows 10. - How to Code .NET

        1. nostradamnit

          For developers, IMHO, NixOS is the most interesting, as you can change your installed environment quickly and easily, kind of like virtualenv with Python, but for the whole system.

          http://nixos.org/

          Reply
    1. Matthew Blott

      I’ve been a more of the .NET *nix club for a couple of years now. I simply had one too many BSD incidents (Blue Screen of Death) that drove me over the edge. I doubt I’ll ever go back. It’s been frustrating at times but liberating as well.

      Reply
        1. Matthew Blott

          I could live with desktop BSDs but I’ve had BSDs on production servers. I know some of this is being addressed with Nano server but the whole culture around Windows isn’t geared up for the command line. By contrast I had to reboot a Linux machine recently that’s running Xenserver and to my amazement found it hadn’t been rebooted in 4 years!

          Reply
  2. Quentin Dixon

    I switched to Linex Mint and I have never looked back. I find it so much more productive, because it never promps me for this or that.

    Reply
    1. Dominick

      I understand the anti-Windows sentiment, I really do – no one hated it or MSFT more than me for so long. But Linux on the desktop is 100x more work than Windows 10 will ever be, sorry. All you need to do is configure when updates are to be installed and pick a reboot time, i.e., 3am

      It’s not rocket science πŸ˜‰

      Reply
      1. Leo Tindall

        You come onto someone post where they said, “I found that I was more productive when I did X, and maybe you should try X because it might make _you_ more productive too.” and said, “Nope, it’s impossible to be more productive by doing X!”

        That’s ridiculous and doesn’t contribute to the conversation. Shut up.

        Reply
        1. Meh Whatever

          I think it’s extremely helpful to point out how easy it is to just disable the updates.

          Telling someone to “Shut up” is par for the course for Linux users who often obviously make emotional decisions instead of just toggling one setting.

          This blog article is a hit piece and it’s basically bullshit.

          Reply
          1. ChristianVolet

            It’s not really that easy. I had to disable them via group policy because the option to “Download automatically and prompt to install” is no longer available in the Windows Update configuration.

      2. MegamanEXE

        Honestly, he has a point. I hear a lot of Windows hate solely because of “Windows notifications hurdurr, Linux never prompts me for anything”.
        All you need to do is turn on ONE option “Ask me before updating”. That’s it, Windows has never annoyed me, I choose the updates and the time myself. I’m glad you found your place in the Linux world (I’m a fan as well) but shifting only because Windows updated without asking isn’t exactly a…good reason.

        Reply
          1. VV

            It’s a pretty big oversight to remove the option from the GUI to control the timing. For an OS that is GUI-driven, to remove it and leave it up to the user to Google how to edit GP to change it is not end user-friendly. I don’t disagree that it can’t be done but that it should be easier than editing Group Policy to do it.

  3. petur

    As a fellow linux user that also has to use Windows 10 at work, I spot some flaws in your Windows bashing:
    1) in Windows settings you can set active hours between which there will be no attempts to install updates or reboot
    2) in the case that you forgot or are working late, and the update/reboot notification comes up, you can again in settings change the planned hour of reboot

    Reply
    1. tanishaj

      Unless my system is different, “Active Hours” can only be a 12 hour window. I wanted to do 7 am until midnight. I could be working anytime in that window with both early morning and late evening being extremely likely (not on the same day).

      “Active hours” does almost nothing to resolve this problem for me.

      Reply
      1. Dominick

        True, but not MSFT’s fault – Miguel de Icaza has always said he will never support Linux so there’s that

        Reply
        1. Eddy Young

          Miguel is very pragmatic when it comes to Linux. He once wrote about the pains of setting up audio on Linux and the reason he left Linux behind.

          Reply
          1. tanishaj

            I think that Miguel has been passionate about Open Source but less so about Linux as an operating system. He gave up on Linux pretty easily.

    1. Piotr Gankiewicz

      Time will tell, although the programming productivity has dropped a little bit, the overall experience is much better. Speaking of the system update – you might be right.

      Reply
    2. Dominick

      ^ this! I love Linux more than anyone else but I can never use it on the desktop – way too much work.

      Reply
      1. VV

        It is a lot of work initially – as is anything new and one has to learn. Sometimes, building a little process in helps. I can literally install Ubuntu or openSUSE in 15 minutes or less, git clone a private repository, and all my dot files are in place and there’s a script that I run to install what I need. It can be just as easy as Windows. I use both at work and have had to rebuild both at work and consistently work harder to keep my Windows box happier than I do with my Linux box.

        Reply
    3. kpolo

      I’ve been using Mint 17 and the other day I accepted some updates and turns out it updated my graphics library to a newer version of NVidia and my external monitor hooked up via display port stopped working. Worse, the machine fails to launch X if I have the external monitor hooked up.

      I’m going to switch back to windows 10 in a few months – the catalyst being the terrible support for external monitors (and multiple monitors) and graphics cards, bluetooth, etc. I’m hoping MS will continue to invest in the Ubuntu user-mode process support in Windows 10.

      Reply
      1. Piotr Gankiewicz

        I’ve switched to Elementary OS a few weeks ago, both on my laptop and PC – the Nvidia Drivers work just fine with external monitors (34″ curved screen), but it seems like you’ve some really bad luck. Well, the more bash on Windows 10, the better :).

        Reply
  4. Axel MΓΌller

    Congratulations, happy to hear about your switch.
    Check out zsh and oh-my-zsh. If you you are impressed with bash you’ll love zsh.

    Reply
  5. katafrakt

    > I’m not trying to say that Windows is not so good for the software development

    But you should! Windows IS really bad environment for programming and there are no signs that it would change in the future – all changes are in the direction to make it even harder for power users to use it. Of course, it can be don’t (I hate people responding do every Windows problem with: “install Ubuntu” or “buy a Mac”), but like you said: if you are not forced to use it by some external constraints, you just should not do it.

    BTW you don’t need to disable UEFI to install Linux πŸ˜‰

    Reply
      1. VV

        Piotr, any of the major distributions (openSUSE, Ubuntu or any other buntu, Fedora, etc) can install UEFI with zero issues for you. If you dd the ISO onto a USB and install from that, it’ll boot fine. Unless you buy one of those new Microsoft Signature laptops, which makes installing any other OS an absolute bear.

        Reply
          1. VV

            I remember Mint having some issues here and there with UEFI but I thought it was resolved at this point. Good luck with getting it going. Feel free to ping me via e-mail if you want or need some help with it.

  6. Pingback: Dew Drop - October 17, 2016 (#2346) - Morning Dew

  7. Jarvik

    Hey,

    Missing application errors when running on Linux is not a reason to develop on Linux, it is a reason to test on all your target OSes.

    Apart from that, enjoy your honeymoon. It’s a great feeling when one discovers Linux and a whole new world of options opens in front of you. I love Linux and have been using it non-stop since the (very) late 90s. I’ve also been using it almost non-exclusively; been a OS X user for years too and now I’m back to Windows thanks to WSL. I do some Golang multiplatform development I can compile on Windows and on Linux (WSL FTW!) without leaving my computer.

    Reply
  8. Sarath

    Thanks, I am also getting started with asp.net on mac. it’s been quite a while I played with microsoft stack. I am figuring out how we manage packages like npm install. Any suggestions?

    Reply
    1. Piotr Gankiewicz

      Are you asking about the .NET packages? For them you can use NuGet and there’s a brand new project.json file where you can define the dependencies and simply run “dotnet restore” to fetch all of the packages.

      Reply
  9. Meh Whatever

    So, instead of taking 30 seconds to disable automatic Windows Updates, this person decided to have a hissy fit and throw the baby out with the bath water.

    The instructions are pretty simple. You have to toggle one setting. Done -http://www.tenforums.com/tutorials/8013-windows-update-autom…

    Reply
        1. Piotr Gankiewicz

          Windows is good for development and IDE like VS is hard to beat, yet the Linux ecosystem in terms of infrastructure (servers, hosting etc.) is more important to me right now than simply developing some apps.

          Reply
          1. tanishaj

            I am with you but arguing back with with a website that works by accumulating opinions with the greatest consensus is a hilarious way to argue against using popularity as an argument.

    1. ChristianVolet

      You can say whatever you want. I’d wager that most Windows users do not know what Group Policy or Registry are. The fact that Microsoft removed these settings from the Windows Update UI is the problem. Not to mention, Group Policy isn’t even available unless you have the Professional edition of Windows.

      Reply
  10. Nico Kittsteiner

    I was a .Net developer for like 8 years. I took the difficult decision of changing stack. Today I develop mostly Java, JS and Python apps. I think that is much more productive than trying to hack an environment to run .Net apps just like on Windows. Love the concept but I really enjoy programming now than all the other years struggling with MS.

    Reply
    1. Piotr Gankiewicz

      The point is that .NET Core is a truly open source and cross-platform framework, so luckily it’s not hacking anymore. Otherwise, I wouldn’t even bother trying to do so.

      Reply
  11. Pingback: .NET on Linux | PipisCrew Official Homepage

    1. Piotr Gankiewicz

      I’m glad that you like it! All I can say that as days go by, I’m becoming happier with the choice I made. Just can’t wait for the Project Rider to be 100% productive with coding :).

      Reply
  12. Pingback: Dev Digest Episode 70 - Intertech Blog

  13. Joe Petrakovich

    Thank’s for this. With all the one off initial set up errors, it certainly sounds like linux to me πŸ™‚

    I dual boot win10 and Elementary OS (a distro that looks and feels like mac).

    I unfortunately have yet to find a laptop/distro combo that is stable enough for full time use. Elementary runs well if I don’t update it. As soon as I do the wifi shits the bed and things start to get weird. Despite all that though, it still feels better to work on as a dev. Maybe it’s just my college roots.

    I’ll give it a go with asp.net core. Thanks again for sharing your experience. It doesn’t seem like there were too many hiccups.

    Reply
    1. Piotr Gankiewicz

      You’re welcome, I’m happy that this post was helpful :). I’ve heard that although Elementary OS looks nice it might be sometimes unstable. I’d go either with Linux Mint or Solus. My experience is getting better every day and I feel much more productive already. .NET Core apps work great, you just need to be careful with some low-level libraries such as System.Drawing or things related to the networking, but other than that Microsoft did a great job by making my favorite framework truly cross-platform!

      Reply
  14. Pingback: A Lemur Eats an Apple | CR 228 | Jupiter Broadcasting

  15. Yeah69

    What about WPF/UWP/Xaml? I develop a desktop app. I could go for Windows.Forms, but since Xaml/MVVM, Bindings, Styles, … I cannot go back.

    Reply
  16. Ney Walens

    Have you tried monodevelop/Xamarin studio for Linux?
    I think it is the closest to VS you can get on Linux nowadays.

    Reply
  17. Shad Hasan

    I tried so many thing to use microsoft product on linux. It was very inconvenient. This post saved my so much time. Anyway I have to figure out to invoke .net command.

    Reply
  18. Pingback: Weekly Links #35 | Useful Links For Developers

  19. Waldo

    Hi !
    It’s nice to read this kind of post.
    Can you do a review of the last past months on Linux? Tell us what tools do you use now and what kind of problem did you have to go through.

    Visual studio is missing you ?
    What lack you from Windows ?

    Please tell us, I’m really curious.

    By the way, I’m a former PHP dev on Linux. Now I work on .Net Core on Windows, but Linux miss me a lot. Specialy a real working Terminal.

    Reply
    1. Piotr Gankiewicz

      Hi,
      Thanks, I’m glad that you found it useful. Honestly, I do not miss Windows at all. I love the Linux terminal and if I was asked to give anyone a single reason to switch to the *Nix that’d be it.
      I’m using mostly Visual Studio Code (and occasionally Project Rider, yet still waiting for some stable release) with the bunch of plugins and also write some simple bash scripts to help with the build automation and so on.
      Sometimes I’d like to get my hands on the full version of Visual Studio again, but it doesn’t happen too often. Anyway, once the Rider comes out it should solve this problem once and for all. Other than that I have everything I need, there are sometimes small issues related to the drivers (e.g. Bluetooth or so), but it’s nothing serious :).

      Reply
  20. Mike Trethowan

    Great post. I have used VB.net for many years as a quick and dirty way of creating test software for external devices such as PIC and Stamp uC prototyping and debugging. There are several of my devices used commercially, so it has been a great tool. However, I was tasked with creating a PC based system that utilizes touch screen for control system for institutional use.

    Windows 10 is so problematic that we recomend that clients not allow these systems to access the internet. This decision has it’s own problems as the systems cannot sync with internet time references and some clients want to use a remote desk top from their smart devices. I have experimented with Linus and the .NET environment but as you point out there were a lot of missing components. Your post fills some of those gaps. I have bookmarked this post so that I can come back to it when I am ready to try .NET on Linux again.

    Thanks and regards,
    Mike Trethowan

    Reply
    1. Piotr Gankiewicz

      Hi Mike,
      Thanks! After few months, as I replied also above I hardly miss anything from the Windows. .NET Core works great on Linux (and also on Mac) and it’s even much easier now to get started with the development process, so I encourage you to give it a shot :).

      Reply
  21. WTF Win

    I develop on Ubuntu at home and have to develop on Windows 10 at work, and to me there is no question, that Linux is the better system for development.
    – Common package source (apt install whatever, tadaa)
    – Path names longer than 255 chars (WTF, I run into “can’t delete file, because filename is too long” all the time on Win)
    – Retarded security (I’m ending up with files I can’t even delete as Admin again and again)
    – Case insensitive file system -> rename case in class names, VCS is broken
    – Native Docker πŸ™‚
    – Git on Windows is so slow that I can get a coffee, even if I do a local operation like ‘git status’
    – Windows has the most ridiculous command line in the world, and that already for decades
    – Symbolic links on Linux are much nicer

    And updates, even if you can configure, when to run them, come on. Every stupid update makes me restart and takes forever. Ubuntu just updates everything in the background, I don’t even have to restart, unless it’s a kernel update, and even then, I can do it whenever I want.
    And the claim, that you lose so much time, because Win is so much user friendlier is bs in my eyes, too. My usual experience is, that Ubuntu installs fast, I hardly need to tinker, system just runs out of the box (and I maintain several notebooks, for many years now).
    Don’t even need to get started about the f***ed up privacy policy of Win 10 πŸ˜‰

    So, congrats, I doubt that you’ll regret the switch, except maybe for dev tools, if you’re caught in the MS universe (I develop JVM languages and EcmaScript, so I don’t have those problems, Jetbrains is your friend πŸ˜‰ )

    Reply

Leave A Comment

Your email address will not be published. Required fields are marked *