Christian Brevik

vNext tools on OS X

October 26, 2014

This weekend I did talk on SOLID at the Knowit Developer Summit 2014 in Stockholm. These five principles are well known to most ASP.NET developers, but it can be difficult to be aware of them in the day-to-day.

Some of the time they are applied instinctively. You just make the code “feel right”. To illuminate the situations where SOLID might be applicable, I demonstrated the principles by refactoring an ASP.NET solution on stage.

And just to make it even more difficult for myself, I did it in:

  • An alpha version of ASP.NET vNext.
  • On OS X.
  • In Sublime Text 3.

I was asked to give a little bit of info on the tools I used, and how to get up-and-running. The following will be a simple guide.

Presupposing some knowledge of what vNext is (if not read this introduction), let’s soldier on!

Getting Started

One of the many good things about ASP.NET vNext, is that Microsoft are using Github! There you’ll find the Home repository which has samples and an install guide.

For OS X I’ll reprint the install guide here, it’s quite straightforward.

  • Install Homebrew if it is not already installed.
  • Run command brew tap aspnet/k to tap the ASP.NET vNext related git repositories. If you had already tapped the repo for previous releases, run brew untap aspnet/k to delete the old commands and tap again to get the updated brew scripts.
  • Run command brew install kvm to install KVM. This also automatically install the latest KRE package from https://www.myget.org/f/aspnetmaster/api/v2 feed.
  • Run command source kvm.sh on your terminal if your terminal cannot understand kvm.

I’d recommend putting source kvm.sh in your ~/.bash_profile as well. Now you have the latest ASP.NET version installed!

The tools

Next you’ll have to install Sublime Text 3 if you don’t already have it. We can install two helpful extensions in Sublime Text 3 to make our life easier.

To do this you need the Package Control, see the link for instructions. Afterwards do the following steps in Sublime Text to install the extensions:

  • Bring up the Command Palette (Cmd + Shift + P).
  • Select Package Control: Install Package.
  • Select Kulture when the list appears.

Then do it again, but on the third step select OmniSharp.

These two excellent extensions gives you a much richer experience with developing ASP.NET in Sublime Text.

  • Kulture gives you the ability to: _ Build, press Cmd + B. _ Run K commands, press Cmd + Shift + P and then Run K Commands. This means for example you can start the server k kestrel or restore packages with kpm restore in Sublime Text.
  • OmniSharp gives you Intellisense inside Sublime Text, and so much more. See the link for more details.

Putting it to good use

Next I would recommend and cloning the Home repository from the ASP.NET-team, and play around with the samples:

git clone git@github.com:aspnet/Home.git

The makers of the Kulture-extension also have a yeoman generator to get the ball rolling:

npm install -g yo
npm install -g generator-aspnet

That about wraps it up, hope it’ll help you get started.


Christian Brevik

Hi there! I'm a developer living in Trondheim. Find me on Github or Twitter.