Saturday, 29 October 2016

Getting started with asp.net core


Introduction
The not so recent change of Microsoft's CEO has brought with it a great new wave of changes and innovations from Microsoft. One of the most notable of this is Microsoft's move towards open sourcing many if not all of its development stack. Microsoft and the developer community has embraced the transparency of open source software.  In this post, I going to introduce asp.net core.

So what is asp.net core?
The asp.net team describes asp.net core as "an open source web framework for building modern web applications and services". It went ahead to say that asp.net core is a framework used for building a scalable web applications that can serve millions of users and requests and made to work with complex web capabilities like web api's, forms over data and real time communications etc.

In other words, asp.net core is the open source version of asp.net. It was built from scratch as a replacement of asp.net and also a framework meant to run on virtually any platform or environment.

Some of the features included in this new framework are:

  1. New modular HTTP request pipeline.
  2. Ability to run multiple .net framework versions side by side.
  3. Cloud-ready environment configuration.
  4. Ability to see changes without recompiling the project.
  5. You can either self-host the project or go with the good old IIS.
  6. Can be run on the .net core or on the full .net framework.
  7. It consists of modular components with minimum overheard.
  8. Finally the source code and bits for this new framework is open-sourced in GitHub.
Also, Asp.net core promises some new benefits. These are:
  1. open source.
  2. Modularity.
  3. Unified mvc and web api.
  4. Dependency injection and middleware.
  5. Developer productivity
  6. Cross-plaform capability.
For more explanation of some of these benefits visit Intertech


Getting started

To get started with using asp.net core you will need to:
  1. For windows users only: Install the .net core sdk using visual studio. (visit here for instructions on how to download and install visual studio 2015). 
  2. For windows users with visual studio 2013 already installed: There are a few hoops for you guys to pass through before developing asp.net core app in visual studio 2013. Though working developing asp.net core in visual studio 2013 is not recommended. These are some of the steps to take
  • First update your .net framework to the latest version (version 4.5.2 will do). Version 4.5.1 will work but Microsoft has ended support for it.(Read for more details).
  • Create a console application targeting the latest .net framework you just installed.
  • Using nuget, download and install the following packages: Microsoft.Aspnetcore.Hosting and  Microsoft.aspnetcore.server.kestrel

For Linux and Mac OS users: Sorry I don't work in any of those environment yet (my bad) so am just gonna point you guys to the direct source.
Conclusion
In this post, I have introduced you to asp.net core, some of its features and the reason why you should switch over to this brand new framework. You should be aware that although the asp.net core is production ready, it has not been fully battle tested and not all the components that you are used and love working with in the good old asp.net is ready yet for asp.net core. But it wouldn't hurt to take it for a spin and see how it feels to work in this new framework.

In the subsequent posts, I will write tutorials about this new framework. Stay tuned.

No comments:

Post a Comment