paint-brush
Building ASP.NET 5 on Ubuntu linuxby@xameeramir
577 reads
577 reads

Building ASP.NET 5 on Ubuntu linux

by Zameer AnsariDecember 25th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

After <a href="http://xameeramir.github.io/configure-net-ubuntu-linux/" target="_blank">configuring&nbsp;.NET on Ubuntu Linux</a>, I was looking at ways to start developing <a href="http://www.asp.net/vnext" target="_blank">ASP.NET vNext</a> projects on <a href="http://releases.ubuntu.com/14.04/" target="_blank">Ubuntu 14.04 Linux</a> using <a href="https://code.visualstudio.com/docs/runtimes/ASPnet5" target="_blank">Visual Studio Code</a>. So, let’s jump in.

Company Mentioned

Mention Thumbnail
featured image - Building ASP.NET 5 on Ubuntu linux
Zameer Ansari HackerNoon profile picture

After configuring .NET on Ubuntu Linux, I was looking at ways to start developing ASP.NET vNext projects on Ubuntu 14.04 Linux using Visual Studio Code. So, let’s jump in.

Scaffolding the ASP.NET project

Since, there is no File -> New Project facility in Code till now, we can either use MonoDevelop or alternatives such as Yeoman, asp.net generator, bower and gulp.

Yeoman is a scaffolding tool for modern webapps. Install it, asp.net generator, bower and gulp using node, using the following command:

sudo npm install -g yo generator-aspnet gulp bower

Scaffolding the ASP.NET 5 project:

  • run yo aspnet
  • select Web Application

  • give name to your project on What’s the name of your ASP.NET application? prompt, I named it FirstASPNET5
  • go to the project folder, in this case using cd FirstASPNET5
  • install the necessary NuGet packages using dnu restore
  • run the project using dnx web

The project will start running at http://localhost:5000.

Troubleshooting

Side note: There seems to be some issue with running ASP.NET with VS Code.

In case of errors, upgrade npm. In my specific case, the <VERSION> is 5.4.1:

Make sure that Mono is latest using mono --version:

Also check if dnvm (.NET version manager) is latest or not using dnvm upgrade, upgrade if not:

After every piece fits into the place, something like this will show up:

Photos

Originally published at xameeramir.github.io.