Introduction
ASP.NET Core 1.0 is not a continuation of ASP.NET 4.6. It is a whole new framework, a side-by-side project which happily lives alongside everything else we know. It is an actual re-write of the current ASP.NET 4.6 framework, but much smaller and a lot much more modular. There is no System. Web namespace anymore and everything which came with it. ASP.NET Core 1.0 is a big fundamental change to the ASP.NET landscape and it is open source. It is also cross platform.
Microsoft has invested a lot of money and effort into making ASP.NET Core 1.0 truly cross platform portable. This means there is a new Core CLR which is an alternative to Mono. You can develop, build and run an ASP.NET Core 1.0 application either on Mono or the Core CLR on a Mac, Linux or Windows machine. This also means that Windows technologies such as PowerShell are abandoned from ASP.NET Core 1.0. Instead Microsoft heavily integrates Node.js which can be utilized to run pre and post build events with Grunt or Gulp.
ASP.NET Core is a modular version of ASP.NET that combines ASP.NET MVC and the ASP.NET Web API. It runs on both the .NET Framework and .NET Core and is designed for building high-performance cloud and micro service apps; it is not intended as a replacement to ASP.NET in the .NET Framework.
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
All sources 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. The packages include logging, diagnostics, Kestrel (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. Microsoft has packaged their own lightweight web server called 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.
Conclusion
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.