Setting up Ubuntu 17.10 for .NET Core Development (including SQL Server, Visual Studio Code, PowerShell and SQL Operations Studio)

In this post I will show you how to set up an Ubuntu desktop that you can use for .NET Core Development.

Why?

Maybe because you want to do Microsoft development on older hardware or because you think Windows is too bloated.

Install the OS

In this example I use the latest Ubuntu version. Mind you, in April another LTS version will be out but I can’t wait and will probably update this article.

Update and essentials

Once installed, open up your terminal and enter:

This the essentials you will want, build tools and zsh.

Oh My Zsh

I prefer the zsh and Oh My Zsh over Bash because of its auto complete features and eye candy.

And the Powerline fonts for a lovely prompt:

Set the default shell to zsh:

Now log out and log back in.
You can then set your favorite theme by editing ~/.zshrc.

Node.js

Next we will install Node.js and fix npm so we can run it without sudo:

Trust the Microsoft sources

Add the repo’s for the .Net Core SDK, Powershell, Visual Studio Code, SQL Server at once

Now install the software:

Configure Sql Server

You will need to run setup to choose the correct Sql Server version and to set the SA password.

Install Sql Server Tools

Next we need to instal sqlcmd:

And we’re done

We now have an Ubuntu desktop for .NET Core development, including Sql Server. Now go ahead and do

Next, install the Entity Framework Core package, create a full fledged backend and enjoy the fact that Microsoft has gone out of its way to make this all possible!

Script

For your convenience: here is a Gist that contains this script.

Links

https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md
https://code.visualstudio.com/docs/setup/linux
https://docs.microsoft.com/en-us/sql/sql-operations-studio/download
https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu

Edit files quickly with Vim on Windows

Vim has always been my favorite text editor on Mac and Linux. But since I spend quite some time on Windows lately I figured it’s time to see how things are now in with Vim in the Windows department.

Vim has always been my favorite text editor on Mac and Linux. But since I spend quite some time on Windows lately I figured it’s time to see how things are now with Vim in the Windows Department.

But first, why Vim? For me the most important reason is that I get to edit files quickly without leaving the terminal.
And that’s a big win. Besides, it’s easy on the eyes too!

Install Vim and ConEmu with Chocolatey

Choco, what else!
We need a decent terminal emulator for PowerShell so let’s install ConEmu as well.

Now we can start vim with the vim command. But of course plain vim is ultimately boring, so let’s start configuring it.

Where are the config files

In ConEmu, open a Powershell shell and enter vim. This wil start Vim.
Then type

Vim looks for configuration in a ‘vimrc’ file.
Now we get to see the environment settings of Vim so we know where to put our config.

Let’s continue using the second entry and create the vimrc file:
Exit Vim by typing

And in your Powershell prompt enter:

Next let’s add some plugins and modifications to our vimrc file.

Install Pathogen

With Pathogen installing Vim plugins is a breeze.

At the PowerShell prompt type:

Then install some plugins by cloning them to the bundle folder you just created:

Create your vimrc

Copy and paste this into your vimrc:

The first section is self explanatory I think. Then this config:
– loads Pathogen
– maps the function key F7 to a command sequence that aligns the code.
– configures the NERDTree to load if you start Vim without a filename.
– The last section is to set the color theme to Solarized and the configure the Airline status bar.

Run Vim!