Setup .NET Core on Ubuntu

MS <3 Linux

.NET Core 1.0 is here and it’s a great, great opportunity to start playing with it not only on Windows platform but also on Linux. Today I will show you not only how to run .NET Core but how to setup whole developer environment for developing .NET.
Since one of Microsoft main goals was multiplatform support, let’s take a quick look on how-to setup .NET Core on Ubuntu.

Why Ubuntu? Well.. it’s popular and easy. Also Microsoft used it as a platform of choice for their Bash and Docker support for Windows so decision seemed quite straightforward to me. We’ll be working here on Ubuntu 14.04 LTS as it’s the most widespread version now.

You can also try other platforms as I did, especially Red Hat Enterprise which is totally free on for developers. They also fully support .NET on RHEL and are part of .NET Foundation. Quite rock-solid backed, isn’t it?

Getting .NET Core on Ubuntu

Well, that’s probably the easiest part as it well documented (for now) at Microsoft .NET Core site.
As stated in docs, execute on after another in Terminal to install the framework:

Let’s try if that worked. Type dotnet in Terminal and see if command is recognized:

Setup .NET Core on Ubuntu

Alrighty. Working as intended!

Enter Yeoman – our beloved code scaffolder

Since what plain .NET Core framework offers us in terms of scaffolding is quite minimalist (we can only dotnet new to create empty project), we must turn ourselves to other tools. One of the most popular (if not the most popular) scaffolder is Yeoman. If you’re Linux fan, you already know it very well from other projects.
In order to install Yeoman we’d need two dependencies – Node.js and npm.
Since Ubuntu 14.04 has too old version of Node.js to run Yeoman, we’d need to update it. That’s the part where I’ve struggled a little, as most of generic Ubuntu approaches I knew did not work out. I’m not Ubuntu pro so I’ve turned myself to internet and browsed for working solution.

This one seems to be always working and I’ve read that it’s generally THE recommended way of updating/installing Node.js:

If update was successful, typing node –version should return version 5.X, where X is the latest version of 5th release.
As we now have proper Node.js version, let’s proceed to Yeoman installation.

Let’s install Yeoman itself with command:

Then, we’d need generator for .NET Core templates:

If everything went smoothly, we should see Yeoman welcoming us in generator when we run yo aspnet in Terminal:


Optional step – Visual Studio Code

That might be a NO-NO solution for wide range of vim or Sublime Text fans out there, but if you’re willing to check what Microsoft has to offer in lightweight, modular code editors, give VS Code a try.
Since VS Code is generally available through site, there is no easy way to get it through terminal.

I’ve managed to get it using wget and downloading .deb package from Microsoft download site to Downloads folder and then installing it via dpkg:

No idea if the ?LinkID=760868 won’t change, will keep in touch with Microsoft to clarify that.

But, but… I want to automate!

Since we’re now in raging era of DevOps, we all want to automate. And that’s great! We should whenever we can.
We can easily pack all the lines above into bash .sh file and run it with preceding sudo to get elevated privileges.

Not enough? It’s fine as I’ve already prepare such script in my ubuntu-helpers repository on GitHub.
Just clone the repo to your Linux machine:

Then just run bash script with:

If you’re willing to contribute to ubuntu-helpers, feel free to do so on GitHub:

Quick thoughts after Daj Sie Poznac 2016 finals

So we’re past ‘Daj sie poznac 2016′ finals and I feel a lot more pumped for further activities than I thought I would be. Competition was great but the finals were even greater. The amount of positive energy and interesting, really diverse topics that were presented made me really happy that I could be part of it. Kudos to the winner of competition, Piotr Gankiewicz and his Warden. Amazing project.
As for my current developer activity in web, Graphinder will currently be on hold, yet I’ve decided to try some new stuff and write my very first JavaScript library. You’ll also see me maybe not much more frequently but definitely in much more places around the web.

More of me in web

I feel quite guilty that I did not do my best to promote Graphinder and my blog per se in recent competition, therefore you’ll see me more and more in web. I’ve decided to share more and ‘attend’ more. As for a nearby future, you’ll hear me in upcoming episode of DevReview hosted by Dariusz Pawlukiewicz @ Forever F[r]ame. I hope you’ll like it!

New project: Selectibles.js

When working with plain ASP.NET MVC I’ve found it to be pain in the ass to use libraries like Select2 and Selectize.
They were often incompatible with jQuery (which I’m not a biggest fan tbh) versions I’ve used and I needed to juggle with them around just to make things (at least) work. What’s more I felt that even when they had many options, doing stuff my way was quite… dodgy.

Therefore, here it comes. My attempt for selectable controls for web.
I’m going to start with basic functionalities that will mimic Select2 from it greater days (ie. when I had 0 problems working with it).
Then, I’ll probably move on to some other controls that would be cool to have but optional to bundle (!).
I would also like to make sure the library does not need jQuery at all. It’s about time for web to move on I guess.

If you want to follow up with the project, it will build up on GitHub:

Graphinder – Quick summary and what next

As Daj Się Poznać 2016 is over, I’d like to share what I have learned, what is current state of Graphinder and what will come next for this project (as it’s not over yet!).

What I’ve learned

Technologies and design concepts

I’ve experimented with many concepts, frameworks and libraries that I wanted to potentially use in my project. Some of them have been already incorporated in project, some of them will be incorporated in nearby future and some of them were left out as decisions had to be made.
I was quite new to Reactive Extensions that I’ve already used in my project and will use even more in nearby future. As I’ve moved on to a very new approach for me – that is – microservices design, I’ve also learned a lot about Actor Model and frameworks based on it, ie. Akka.NET and Microsoft Orleans. As Orleans got my love for now, it will be used in Gateway.Api soon.
Finally, I’ve reached a place in my self development where I feel confident enough to embrace Test Driven Development, that I’ve also embraced during this project.

Soft skills and self development

Although it seems it wasn’t a case for every competitor in Daj sie poznac, I felt obliged to share my progress on both blog and Github.
I’ve enforced a week discipline and managed to both post twice a week and commit multiple times a week to the project.
What I’ve also learned is that none of us is bulletproof and creating a project after hours is a tough task from both social, family and physical point of view. Sometimes, I had to let go to get some rest, charge batteries and spend time with family but overall, I think the result came out great. 😉

Skills I have refreshed

As a developer with experience in ASP.NET stack but working currently in game developement in Unity3D environment, I’ve also managed to refresh some of the web stack skills, mainly ASP.NET WebAPI skillset, some of the web design concepts and Azure deployment and configuration concepts for web applications.

Current state of project

What has been completed

I’ve managed to complete two algorithms (Simulated Annealing and Genetic Algorithm) that work on one optimization problem (Minimum Vertex Cover), reporting reactively with Rx.Net on every progress update.
Completed solution finding gets persisted using Entity Framework to Sql Server, where I’ve embraced CQRS approach of commands and queries instead of Repository pattern.
There’s also basic mechanism for registering, connecting and delegating work to solution finding Web API instances in Algorithms service context from Gateway, yet there’s still much work to come.

What’s still to come

Well, actually the front end of application is.. well.. still to come. 😓
Also gateway is not fully functional (misses few administration and business concepts) and Orleans silo is waiting for deployment and configuration for progress report to SignalR hubs.

As for the rest, well… Let the code defend itself:

What’s next?

The project will be on hold until holidays will come. I’ve been quite busy with other projects and everyday life, so both gateway fixes and frontend implementation will need to wait. All I can promise is that project will not end with Daj sie poznac and it will go on as my playground for improving both architecture design and coding skills for upcoming future.

And, in the end, congratulations to all of the competitors that made it to the end. Good luck! 👍