This is amazing really. Not only can you install ASP.NET MVC 5 on a Chromebook, but you can also get Microsoft’s new open source code editor called Visual Studio Code running as well. Seeing Microsoft embrace cross platform editors, open sourcing code and supporting Mono is somewhat disconcerting. Not that it’s a bad thing. Just…well…it’s not the Microsoft of old, that’s for sure.
Installing ASP.NET on the Chromebook is fairly simple. You need to have crouton installed obviously, because this allows you to run a full desktop Linux install on your Chromebook. I’ve also got the crouton extension which basically allows the Linux desktop to run in a browser window!
Once that’s out of the way, run crouton (the default puts you into xfce) and install Visual Studio Code - download the .zip file and unzip it into a location of your choice. I had to install libnss3 to get the editor to run - this is a simple:
sudo apt-get install libnss3
from a terminal in xfce (YMMV):
{: .center-block}
If you’re hitting problems, or Visual Studio Code just isn’t running, try running it from the terminal to see if you are missig any dependencies.
Then follow the instructions to install Mono on Linux. I had to manually create ~/.config/NuGet/NuGet.config, but I just pasted the suggested default in there and off I went.
Then simply continue following the Linux instructions for ASP.NET. This boils down to upgrading DNVM:
dnvm upgrade
Now clone the samples:
https://github.com/aspnet/home
This will create a home
directory for you. Now you need to change into the samples directory:
cd home/samples/latest/HelloMvc
At last you’re ready to run the sample and as per the docs, you need to do the following:
dnx . kestrel
Which will fire up the kestrel web server for you and serve your ASP.NET MVC 5 sample application on your Chromebook on port 5004. Exit the full screen xfce and come back into your chrome browser, pull up a new tab and enter the address of http://localhost:5004
and you’ll see the default ASP.NET MVC 5 Hello World application. I’ve changed my view just a little:
{: .center-block}