.net core tutorials

Create a .net core web application on ubuntu in 5 minutes





I have been spending the past few weeks getting familiar with .net core, the latest release of the .net framework from Microsoft.  I will be the first to admit that I am totally impressed by it and I am truly excited by this version of the framework.

The world I have been inhabiting over the past 4 or so years has been a world  of cross platform applications.  Typically developing applications which are designed or at leasts components of applications that are required to run on any mix of operating systems and platforms i.e. Windows. Mac and Linux and Web , Mobile and desktop.

I have always been fan of the .net framework and the Microsoft development tool stack in general but have not always been  a huge advocate of the  windows operating system.  In my  opinion it has always been so ironic that Microsoft have always created great development tooling but were always let down by the operating system.

Install .net core and VS Code

 

I installed the .net core and the super light weight development text editor called VS  Code, following the super easy to follow instructions on the Microsoft website. https://www.microsoft.com/net/core.

Create new web project using the terminal

It is really super easy to create a new web project using terminal window and open the new project in vscode afterward.

 

Running these simple commands will generate necessary boiler plate code required to start working on your next great project.




More templates

Although the above approach my generate you a template really quickly. The template itself is somewhat limiting and it pretty much based on the Microsoft MVC template, which is fine but if you would like work on more current technologies or would like to explore other options. There are alternate templates available.

The aspnet core team have made these templates available via the Yeoman generators, which will require the installation of yo and aspnet core yo generators.

You can install yo via the terminal if you have NPM (Node Package Manager ) . If not I recommend you install node using NVM (node version manager) on ubuntu.

We can now install the aspnet generators

Once complete we can now use it to generate our projects

Which will present the a screen and you can make your selection of the type of project you would like to create

Additional Single Page Application Templates

The community has been really busy creating some addtional project starter templates , which include using addtional frameworks like Aurelia etc. Check out Steve Sandersons blog for more information.

These templates are also available by making use of the Yeoman Generator, and are simple to install. However, before we install these templates there is one additional dependency we need to install called Webpack

We can now install the generators

Once installed we can generate a project using

Dotnet Core RC4 Templates

If you prefer make us of the dotnet new command to generate a project, you can but it will take an extra bit of configuration and you will need to install RC4 of the SDK tools

Once the install is complete, add the addtional templates

Once complete, you can then try dotnet new --help which then should display a list of new templates that are available.

With these new templates available you can then generate a new project using dotnet new [templatename] to generate a new project like

You can read more about these templates – Building Single Page Applications on ASP.NET Core with JavaScriptServices



Gary Woodfine

Freelance Full Stack Developer at threenine.co.uk
Helps businesses by improving their technical proficiencies and eliminating waste from the software development pipelines.

A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.

Affiliate Disclaimer

Disclosure: Please note that some of the links included in the blog posts are affiliate links, which means I will earn a commission if you decide to make a purchase.

I only include affiliate links to products, services and companies that I have personal experience and have actually used. I only recommend them because they are helpful and useful, not because of the small commissions I make if you decide to buy something.

Please do not spend any money on these products unless you feel they are relevant, suitable and will help you achieve your goals.

Buying anyone of these products and the commisions earned will not make me an overnite multi millionaire, but they will help to cover the hosting costs and compensate for the countless hours and effort I put in to create meaningful and valuable free content I provide to help others succeed.

You've also undoubtedly noticed that I also use various advertising networks - unless of of course you're using an Ad blocker, this is also an attempt to reduce my monthly deficit I experience in providing free relevant, valuable and on occassion insightful content for the benefit of others.

I only really make some money if people click on the ads, unless of course you consider 1c per 1000 impressions real money!

Bear in mind just how many impressions I need to make before I can cover my £20 hosting costs a month!

If you are using an adblocker and guilt stricken you can of course donate using any of the buttons below, but I won't be holding my breath.


Buy me a coffeeBuy me a coffee
π