651.288.7000 info@intertech.com

This is a short overview of the upcoming RTM of ASP.NET CORE 1.0.

First, a word about names…

Microsoft product names can change at Microsoft and this new version of ASP.NET and the .NET framework are no different. For the past year this has been known as ASP.NET 5, but as of this writing a name change has been announced in a blog post by Scott Hanselman. Therefore, I’m going to refer to it here as “ASP.NET CORE 1.0”. Here is a quick overview of terms as I know them:

ASP.NET CORE 1.0 Formerly known as: ASP.NET CORE 5 or ASP.NET vNext. This is the new ASP.NET code and the topic of this blog post.

 

.NET CORE 1.0 Formerly known as NET CORE 5. When ASP.NET targets this version of .NET, the resulting package is portable to any machine running DNX

 

Note: The current ASP.NET 5 Templates in Visual Studio 2015 shows two targeted execution environments. The first is DNX 4.5.1 which is the familiar .Net framework currently installed on the current machine. The second is DNX CORE 5.0 which is the same as .NET CORE 1.0 above.

A big change for ASP.NET development

The anticipated RTM of ASP.NET will bring a number of changes for developers looking to work with MVC or WEB.API. In fact, ASP.NET Core 1.0 is a complete re-write of ASP.NET that reflects a more modern view of software development. The changes are certain to impact the way you develop ASP.NET sites going forward. However, this new approach promises a number of important benefits:

  • Open Source
  • Modularity
  • Unified MVC and WEB.API
  • Dependency Injection and Middleware
  • Developer Productivity
  • Cross-platform capability

Open source

All source for ASP.NET Core 1.0 packages can be found at their GitHub site. Microsoft and the developer community have embraced the transparency of Open Source software.  ASP.NET’s GitHub site has a large number of active repositories which contain the source for the major features of ASP.NET, as well as middleware, demos, and useful tools. All projects are actively updated by both Microsoft contributors and the community at large. This approach enables a faster development cycle and continuous code improvement.

Modularity

NuGet packages have become the standard way to add new functionality to applications. Since Visual Studio 2010, developers have used the Package Manager Console and the NuGet Package Manager to install and configure frameworks and libraries. This has now been extended to include the core features of ASP.NET. The .NET developer has the ability to pick and choose which ASP.NET features to include in their solutions.  This opt-in model allows developers to be more deliberate with regard to which libraries are included in their projects.  Available packages include logging, diagnostics, Kestrel (a new hosting server), and more. When code evolves at a rapid pace, packaged-based software helps make maintaining and updating projects easier.

Unified MVC and WEB.API

In previous versions of ASP.NET, MVC and WEB.API were based on different versions of the framework: System.Web.Mvc and System.Web.Http/System.Net.Http, respectively. At a minimum, the differences in the concepts, namespace organization and classes led to confusion.  For example, the base class for controllers (Controller) was in a different namespace than the common result interface for controller actions (IActionResult).

This has been resolved with ASP.NET CORE 1.0 MVC 6. There is now a single set of objects within a single namespace (currently Microsoft.AspNet.Mvc). This standardized approach simplifies developing both MVC and WEB.API endpoints.

Dependency injection and middleware

Dependency Injection has become a widely-accepted industry practice. It separates the concerns of type resolution from lifetime management and enables more effective unit testing. It has always been available as an add-on to ASP.NET development by using Microsoft’s own Unity library or a third party library such as Autofac or Ninject. Now, dependency injection is integrated into the framework. Third party products such as Autofac should still be available as an alternative to the build-in ASP.NET DI functionality.

Developer productivity

IIS is the logical web host for all Microsoft web products. However, some developers prefer a lightweight web server like those built upon node.js. In response to this need, Microsoft has packaged their own lightweight web server, Kestrel, with ASP.NET.  This has several uses, from development to cross-platform use. In fact, Kestrel can be chosen as the development server within Visual Studio 2015. Kestrel enables the developer to run their site on OSX. If the developer is using the new editor, Visual Studio Code, they will be able to edit and debug ASP.NET CORE 1.0 solutions on OSX. Developers on any platform only have to save changes and refresh the browser – the tedious compile process has been eliminated.

Cross-platform

ASP.NET Core 1.0 will run on the existing version of the .NET framework (4.6), but is designed to use the new .NET Core 1.0. When the .NET Core 1.0 is targeted, the framework code will be packaged with the deployed app. This version of the .NET framework has been ported to function on OSX and Linux. This extends the usability of .NET development beyond the Windows platform. If developers wish to work in OSX or Linux, Microsoft has developed Visual Studio Code – an editor that will allow the user to develop on any of those platforms.

Final thoughts

ASP.NET on the .Net Core 1.0 framework enables the most flexible version of ASP.NET yet. Its modular design, updated programming model and productivity improvements are certain to make it popular with developers. It is difficult to predict whether the cross-platform capability will be popular. Overall, it is good to see Microsoft re-inventing its product with the future in mind.

 

Resources

ASP.NET documentation http://docs.asp.net

ASP.NET source code https://github.com/aspnet

ASP.NET in-depth discussion https://channel9.msdn.com/events/DXPortugal/Microsoft-WebCamp-2015/ASP05

Microsoft Virtual Academy training https://mva.microsoft.com/en-US/training-courses/what-s-new-with-asp-net-5-8478?l=jAHFbiXz_1004984382

Visual Studio Code: https://code.visualstudio.com/

Interested in learning about ASP.NET Core? Check out Intertech’s new Introduction to ASP.NET Core Development Training Course! Aquire the skills necessary to design and build well-architected web and service-oriented applications that follow the MVC design pattern.

Like What You've Read?

Subscribe to the Blog.

Every Friday we send that week's content from our Developers via email. Try it out!

Some ad blockers can block the form below.

You have Successfully Subscribed!

Pin It on Pinterest

Share This