Home .NET ASP.NET vNextTopic

ASP.NET vNextTopic

by admin

Expected platform release ASP.NET (vNext) is one of the most packed in terms of innovations.But along with all the innovations comes a huge number of new specifications, components, and other features. At the same time, the world of .NET is evolving at such a speed that it is almost impossible to simply keep up with all the news of web-development from Microsoft. Especially if you still write in technologies from 10 years ago (ASP.NET Web Forms, .NET 2.0) or come from outside of the .NET world of web development. Perhaps now is one of those moments when you can skip all the versions of previous updates and, starting from scratch, get into a new flow of platform development. Let’s lookat the main points for this :

  • vNext
  • Roslyn
  • OWIN
  • Katana
  • K


ASP.NET vNext is the next version of the ASP.NET platform. It is still in development, but the part that has already been presented to the general public shows that the changes in the platform are enormous. The goal of the new release is to create a trending stack for .NET to build modern cloud-oriented applications.
The main features of :

  • Open Source Code,
  • Cross-platform,
  • Based entirely on the new Roslyncompiler,
  • MVC, Web API, and Web Pages are combined into one framework, MVC 6,
  • Dependency Injection is built inside the framework,
  • No dependency on web server and hosting platform,
  • No longer dependent on System.Web superlibrary

In addition to the tremendous work on updating the platform, the very approach of how these changes are presented to the community has also changed. The social component of the release is very interesting and it has become very convenient to follow the platform. In addition to blogs and news on social networks there are open previews where you can get a good feel for the platform. And also there is an interesting format Community Standup – you can ask questions or hear online from the developers of the new platform. All this happens in a fun and interesting way and allows you to watch the development of the platform "in first person", almost by participating in it. Standups take place in Hangouts every week and are then posted on YouTube.


The new compiler (compiler platform) from Microsoft has been talked about for a long time. The first preliminary version was released 3 years ago (in 2011). But the plans for the compiler are big. First of all it will also be open source (since April, 3 under Apache License 2.0). Secondly Roslyn supports scripting. So it’s possible to execute pieces of code on the fly. Advanced consoles with C# support already started to appear. Also Roslyn has its own API for developers to use. It’s interesting that the compiler itself is written in C#.
As for the differences in the work for the average programmer it is hard to say anything yet, in theory with the new compiler and the new ASP.NET project type (web site and web application are no longer separated into different projects) the waiting time for compilation and update the page when the source code changes should be significantly reduced. Ideally – change the code, press F5 and the site is right in front of us.

OWIN — Open Web Interface for .NET

This standard is probably what started the changes from the very basics. In the first place, it’s not a platform or library, it’s just a specification, a set of rules. OWIN – A specification that defines the standard interface between a web server and a web application.
Often another name is used – Middleware. Its purpose is to separate server and application, as well as (since the standard is open) to allow and encourage development of standard implementations.
What is the practical value? Without OWIN all the work of the application is tied to how the web server (IIS) talks to it. If you have a middleware layer, it’s not tied to the web server, and the web server can be anything that works with OWIN.
There can be any number of such intermediate layers and you can put separate logic or distributed functionality into them.
ASP.NET vNextTopic
Interesting point in the specs OWIN, that all interaction between the application and the server through the middleware layer is reduced to a single function, the application delegate.

using AppFunc = Func<IDictionary<string, object> , Task> ;

The collection <string, object> which is called environment dictionary contains the server parameters, the request and the response. It cannot be empty and cannot have null values. There are also some mandatory keys, defined in the specification. The result of the processing is an object of type Task, that is an encapsulation of the task being executed. Each OWIN-based component has its own application delegate and at runtime the server calls a pipeline of such handlers. Since each application delegate returns a Task, all components in the pipeline are asynchronous.
As I said before OWIN is just a specification, the rules which should be followed in the middle layer between the server and the application. So how do you implement it practically or where do you get an already implemented one?


Katana is one of the implementations of the OWIN specification. It is implemented by Microsft, so you can also see the name Microsoft OWIN. As with other ASP.NET vNext related products, the source code for the Katana project open
If you look at what this means for developers, the answer is that the changes are actually only for server-related functionality. No more settings and events like global.asax. The new standard is the Startup class. A minimal web application can now be described in a few lines.

public class Startup{public void Configuration(IAppBuilder app){app.Run(context =>{context.Response.ContentType = "text/plain";return context.Response.WriteAsync("Hello Habr!");});}}


As you learn the platform, you will often come across K – Project K, K version manager, K runtime and even the console command k. So what is K?
The original name of the new ASP.NET platform was Project K (possibly K from Katana). The names Project K and ASP.NET vNext are actually the same thing – the new release of the server development platform.
KRuntime – the foundation of the platform, a software environment with open source It contains the SDK and the runtime itself (more exactly kvm, kpm, kre).
kvm (K Version Manager) – K platform version manager. Practically a console command to manipulate the versions of the runtime (install, uninstall, change the default version).
kre (K Runtime Environment, less often Engine) – the part responsible for compiling, the SDK, everything you need to run an ASP.NET vNext application. In principle, a specific version of kre goes for a specific application, moreover, you can package your own version. For your application, kre is just another one of the nuget packages.
kpm (K Package Manager) – package manager. Manipulates additional packages that are needed by the application.
k (console command) – entry point for working with the platform. The main console command to compile, run the application.
To understand how these commands are used in practice, consider the following scenario :

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"kvm upgradegit clone https://github.com/aspnet/Home.gitcd HomesamplesHelloWebkpm restorek web

This is actually all you need to do to install the new platform version and run a simple application. After running the last command(k web) you have at http://localhost:5001/ will have an elementary website hanging. It will take less than a minute to execute the commands.

Try more

Currently released ASP.NET vNext CTP 4 and Visual Studio 14 CTP 4 (Community Technology Preview – version 4). It looks like this is the last alpha version and the product is moving on to beta. To try how the new technologies work and evaluate other new features you can download Visual Studio "14" CTP 4 (but there is no guarantee it will work or that other products will not break) or you can run it on the ready made virtual machine in Azure

You may also like