.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.

105 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. Tóth Áron

        Really helped a lot because I wanted to use Linux instead of Windows!!
        Now I’m using VS Code with dotnet on Linux pretty awesome Thanx a lot!

        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
          1. Kevin Burns

            My eye keeps twitching every single time you guys say “BSD,” BSD is a type of Unix invented at Berkley, what you are inferring too is “BSOD”(Blue Screen Of Death).

  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. Ladislav Jech

        Hi Dominick,

        I am on Gentoo Linux for years as default desktop (I work as hands-on architect mostly on SOA, in later years microservices, big data and AI stuff), and it is not only about stability of the system, where it shines (but you can of course on new hardware meet kernel panics as well :-), but what made me really tired of Windows was what I call: CLICK and WAIT style of development of anything.

        I even don’t use binary distros like mint, but rather compile whole system with CPU and GCC and kernel patches for low latency optimizations, so when I click on something I get directly response. This is what I hated most on windows, the latency between command and feedback. Fresh install of Windows 10 looks fine, but once you install whole stack of applications you work with and get some set of updates in few months, the system bubbles always into lazy shit.

        Reply
        1. Ladislav Jech

          Even fresh windows will be always lazy shit, because of microkernel architecture against linux monolithinc kernel architecture. Where windows need to use interprocess bus, linux kernel just have internal direct access. But take me lightly, I am high performance extremists :-)))))

          Reply
  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
    2. Clifton Wood

      This only works if you do not have an Active Directory Group Policy that manages these settings, and do not have administrator privileges to override it.

      Many large development (and GOVERNMENT) facilities do it this way to insure “the proper environment”. Sure, if you are going to run Linux, you will need permission from the higher ups, but sometimes it’s easier to get approval for a Linux dual-boot than it is to get the CIO to change the policy.

      Reply
    3. Richard

      Windows 10/2016 give you 12 hours of work time and windows will want to reboot after that time. Well I have many machines that need access for longer than 12 hours. This is very frustrating as well as after the updates are installed all your preferences are reset, and they update weekly. Dont get me started on the telemetry fiasco.

      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
        1. IPassOnIt

          Not initially… perpetually. Linux is a huge pain in the ass. Don’t get me wrong,
          there are things about Linux I like, but ease of configuration and usability are not its strengths. And if you cringe at Windows updates, why are frequent Linux updates ok?

          Reply
          1. Richard

            because linux does not reset your preferences and environment that windows resets every week. No I dont want to use Edge as my default browser.

    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. Clifton Wood

      This is why I run APT based distributions. I have rarely had an update that took longer than a Windows Update. I can download over a gig of new packages using Ubuntu and have it be complete in less than an hour. Try a Windows Service pack, and extra stand-alone updates, my machine can be unusable for twice that long.

      Please note: I have a Windows box at home. You just can’t get by in this industry without it. However, for my sanity: I have a guest VirtualBox linux image; and also a dual-boot partition in case I need the extra horsepower.

      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
      1. Dante

        Actually, Xamarin Studio for Windows = MonoDevelop for linux which is not available by that name on Windows.
        And believe me, you need to give it a shot. Try the Flatpack version, you won’t regret it.
        MonoDevelop is Awesome, I find it better than any other .net / mono / C# IDE available on Linux.

        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
    1. Piotr Gankiewicz

      Yes, exactly these points! I’ve switched to MacOS a few months ago, but on my stationary PC I’m still using Linux and it’s much better development environment, especially given the fact that I’m running the .NET Core apps on the Linux servers as well :).

      Reply
  22. JohnMorris

    Piotr,
    When it comes to Linux I have installed and used many different flavors from Ubuntu, Mint, Fedora, ElementryOS, you name it I have most likely used it at one time. There are some that I enjoyed and then some that if I had a sledge hammer I would smash my pc. Great write-up on this and I hope that you don’t run into to many problems with Mint.

    Reply
  23. Ayomikun

    please i need help
    i want to create Windows form softwares on linux because i like the comfortability with linux, but the IDEs’ i have been getting have just been to run console apps. i need to be able to do GUI to, especially with rider IDE

    Reply
  24. Some dude, not important

    Great article! I really enjoy reading your blog. Lots of valuable information! Can I ask what you use as blog engine – if you are using one ;).

    PS: Some quick constructive critique 😀 : you don’t need to type “the” in front of stuff, it makes the sentence unnatural in a way ;P. Example: “I needed a device with _the_ touchscreen”, is better replaced with “I needed a device with _a_ touchscreen”. Also, “start using the *NIX system for _the_ software development”, is better off as: “start using the *NIX system for software development”.
    Sorry, I am a grammar nazi… 😛

    Reply
  25. Magnus

    .Net is just slow big mess. There is no point using it unless you are locked onto an Windows desktop. Everything you can do in .NET can you do with other libs.

    Reply

Leave a Reply to VV Cancel reply

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