In October I attended DEVintersection 2015 in Las Vegas. My main interest was to learn about ASP.NET 5 and so I concentrated in the
What I learned about ASP.NET 5 was very illuminating and interesting. It’s a whole new multiplatform world now. If you are a MacOS or Linux person, you owe it to yourself to take a new look at ASP.NET 5.
During my stay in the
One of my principal reasons to join these conferences was to understand how the ASP.NET 5 works. I also wanted to learn how to create a web application using ASP.NET 5 on Windows, Linux, and MacOS.
What is .NET 2015?
.NET 2015 was about all things released to .NET. It includes the .NET Framework 4.6 and .NET Core 5 which contains CoreCLR and .NET Native. ASP.NET 5 includes ASP.NET MVC 6 with web API, Entity Framework 7, SignalR 3, etc.
- DNVM. It is the .NET Version Manager, a set of command line utilities to update and configure which .NET Runtime to use. You can use DNVM list to see all the runtime you have installed. For more see how to use DNVM.
- DNX. It is short for .NET Execution. It has everything you need to build and run .NET applications for MS Windows, MacOS, and Linux, and across different .NET flavors (.NET Framework, .NET Core and Mono). For more,see the DNX Overview.
- DNU. Short for .NET Utilities. It is used to manage the dependencies in a .NET 5 applications by installing or restoring the packages associated with a project (i.e., project.json).
- Kestrel. This is the new cross platform OWIN Web Server for ASP.NET 5 based on libuv.
- OmniSharp. This is a cross platform project to have a great programming experience no matter what your editor and operating system of choice may be. For example, in MacOS you can use Visual Code. You have access to features like
format documentand many others when you are programming.
- Roslyn. It’s a .NET Compiler platform. It provides Open Source C# and Visual Basic compilers with rich code analysis APIs. It enables building code analysis tools with the same APIs that are used by Visual Studio. For more, see the Roslyn Project site.
- .NET Core 5. It’s a small and optimized runtime that can be targeted by ASP.NET 5 applications.
- Yeoman. A scaffolding tool for modern web applications. This tool helps you to kickstart new projects, using best practices, and tools to help you stay productive.
Why Program in ASP.NET 5?
ASP.NET 5 is an Open Source web framework for building modern web applications to run on Windows, Linux and Mac. It includes the MVC 6 framework, which now combines the features of MVC and Web API into a single framework.
There are a number of architectural changes in ASP.NET 5 that makes the core web framework much leaner (e.g., it no longer requires System.Web.dll) and it is modular. For example, almost all features are now implemented as NuGet modules and this allows you to optimize your app.
ASP.NET 5 is now decoupled from IIS and System.Web. It also removes remaining impediments to running .NET websites on other platforms.
With ASP.NET 5, you can develop any project in any platform and run it in IIS for windows or Kestrel for Linux and Mac.
More than Visual Studio
You can develop using Visual Studio 2015 for Windows, or the Editor you want (e.g., Sublime, Atom, Emacs, Vim, Brackets) for MacOS/Linux.
Lightweight and Modular HTTP Pipeline
ASP.NET 5 introduces a new HTTP request pipeline that is modular so you can add only the components that you need. The pipeline is also no longer dependent on System.Web. By reducing the overhead in the pipeline, your app can experience better performance and a more tuned HTTP stacks. The new pipeline is based on lessons learned from the Katana project and also supports OWIN.
ASP.NET 5 is a open source project on Github. You can even create pull requests. Microsoft hopes that making ASP.NET 5 Open Source, the developers community will contribute to the project and understand better the idea behind the code.
What’s Good about ASP.NET 5
Visual Studio 2015 supports a dynamic compilation. You no longer have to compile your web application every time you want to see a change. Instead, just edit the code, save your changes, and refresh the browser.
Integration with Grunt, Bower, and GulP
Another amazing feature in Visual Studio 2015 is built-in support for Bower, Grunt, and Gulp.
ASP.NET 5 has a new project.json file to manage all thedependencies as NUGET Packages. The project.json file is easy to work with and you can edit it with any text editor. This enables you to update dependencies even after the app has been deployed to the cloud.
ASP.NET 5 has built-in support for Dependency Injection and the Service Locator pattern. This means that you no longer need to rely on third-party Dependency Injection frameworks such as Ninject or Windsor Castle. But, if you prefer to use one of these, you can.
This is the new Unit Test tool for .NET. You can wave goodbye to mTest and hello to xUnit.net. The latter uses the [Fact] attribute instead of the [TestMethod] attribute (and no [TestClass] attribute]).
What’s Not-so-Good about ASP.NET 5
It’s still in RC1 state. Microsoft is expecting to get feedback from the community to improving performance and reliability. Please check the ASP.NET 5 Roadmap for more information.
Documentation is Not Complete
The ASP.NET 5 documentation is not complete and lacks deeper information and concepts.
What Does the Future Look Like?
In my opinion ASP.NET 5 is a very ambitious project from Microsoft. We can take advantage of it to create cross platform web applications.
Having a development environment that includes Open Source libraries will make things easier.
Also, it will be an opportunity to attract new developers who think .NET is very difficult to configure for web apps. Now, they can develop a web application on their favorite platform, using the editor you want.
And Finally …
I recommend that you review the ASP.NET 5 site. In particular, take a look at the Introduction to learn about these new concepts. Then, continue with Getting Started and install all you need for your prefered OS. Also, check out Your First ASP.NET 5 Application Using Visual Studio.