Previously, we have written introduction about ASP.NET Core on our blog and also tips to deploy it on shared hosting environment. In this post, we will post interesting facts in vNext that you need to know. We have made few conclusions about this new features.
Fact #1 – It Combined with Application Models
ASP.NET combines MVC, Web API, SignalR and Web Pages into one framework, collectively called MVC 6. ASP.NET MVC 6 harmonizes controllers, views and models and no longer requires System.Web.
Why you need to know:
The gradual achievement of the ‘One ASP.NET’ vision is finally with us and the same code patterns work for the different technologies. No longer will MVC act similar-but-different to Web API. Microsoft has signaled the future of web application development.
Fact #2 – Have Two CLR Versions
There are two versions of .NET Framework – the regular .NET version and the new ‘Core’ Common Language Runtime (sometimes known as ‘CoreCLR’). The full CLR is sometimes referred to as the ‘Desktop’ or ‘Full’ CLR. The CoreCLR has nothing in the Global Assembly Cache and multiple versions can be installed side by side on the same machine. The CoreCLR is a cut-down version and is optimized for high throughput with low memory – otherwise known as ‘Cloud Optimized’. ASP.NET will run on either the ‘full’ CLR or the Core CLR, depending on what dependencies are needed. The Core CLR is fully open source and available on GitHub, and runs on Linux/Unix/OSx via Mono.
Why you need to know: ASP.NET applications developed for vNext will benefit from targeting the CoreCLR. This will allow cross-platform deployment, simpler deployment models and less problems from version conflicts. But choices need to be made early in the project pipeline to ensure that Desktop CLR dependencies are not included in code. The CoreCLR runs with a fraction of the memory required for the previous .NET frameworks. Existing projects using technology such as MVC 5, Webforms, SignalR 2 or Entity Framework 6 will need to use the full CLR.
Fact #3 – One Simple Project Type
ASP.NET projects are no longer different types like ‘Web Application Projects’ and ‘Web Site Projects’. In fact you don’t even need a .csproj or .vbproj file for a web project. Instead, the project is directory based, and the key file is now called ‘project.json’. The project.json file doesn’t include a list of files but simply lists the dependencies of the project.
Why you need to know:
Theoretically you’ve never needed Visual Studio to compile and run a project, but it was difficult to try. With the advent of directory-based projects and no Microsoft-specific file formats, any decent text editor can become an ASP.NET editor. This includes cross-platform text editor support, such as using Sublime Text on OSX. As you can now build and run an ASP.NET project on OSX, it really is a true cross-platform solution.
Fact #4 – New Compiler
ASP.NET vNext uses the ‘Roslyn’ compiler, which is a managed compiler written in it’s own language (the C# compiler is written in C#). Roslyn compiler technology is fast and enables true ‘edit and run’ capabilities. There is no need to compile an ASP.NET application and deploy the binaries, as you can just deploy the code files and let it compile in place. Roslyn is open source and hosted on Github.
Why you need to know: Changing to a simpler deployment method will change the way ASP.NET applications are developed and deployed. The ground-up rewrite of the way that C# and VB.NET are compiled will also change the toolsets available as Roslyn exposes detailed information about the compilation process, and theoretically allows you to develop your own implementation.
Fact #5 – Changes to the Application Pipeline
The ASP.NET pipeline has been re-invented. Understanding and manipulating the ASP.NET pipeline was always difficult, and there was no concrete guarantee that modules listed in a web.config file would execute in the expected order. Not only is the web.config file gone, but you can also explicitly specify the pipeline execution components and order. This is done in the simple ‘Startup’ class used in ASP.NET applications.
Why you need to know: The traditional httpModule/httpHandler model is now a specific programming order instead of a set of components listed in configuration. That may sound difficult to use in a production environment but the truth is that a binary-compilation and deployment is not necessary, so changing the pipeline is as simple as changing the order of code in the Startup class.
Fact #6 – You can run in on Open Source
Just about all of ASP.NET is now open source and hosted on Github. There was once a debate that you couldn’t call open source projects like DNN ‘true’ open source because there were closed parts of the stack. If you now run Linux-Mono-.NET with Roslyn compile you have a completely open stack from top to bottom.
Why you need to know: We are in a new era of Microsoft tools and frameworks. The release cycle of years gone by when a fully formed new version dropped every year or so is a relic of the past. You can now observe the next generation of tools being developed in real time – and you can also participate by finding and fixing bugs in the core implementation.
These topics merely skim the surface of the changes in ASP.NET vNext. If you’re curious about any in particular, feel free to ask questions in the comments – We’re sure the DNN community will eagerly answer any queries. The DNN team will be creating some more blog posts in the coming weeks on ASP.NET vNext, so feel free to request a specific topic to cover.
[crp]