OWIN and Katana - what's the big deal?
OWIN stands for The Open Web Interface for .NET. It is a standard for communication between .NET web servers and web applications. It defines required elements for HTTP request (details). It is inspired by Rack from Ruby on Rails World. Katana is implementation of this standard. We can say that it is a lightweight web server for .NET. In fact, it is more than that (more info here).
First, we need to create application project. Let's create 'Empty Web Application' (it might be also Console App).
Next, we will install two NuGet packages (using Package Manager Console):
Then, we need to create 'Startup class'.
Now we are ready to run our web server, but you may get following error:
Fortunately there is easy fix for that. You need to modify Web.config file, adding following code in configuration section:
Then you can run server (CTRL+F5) and you should see:
So, what is big deal? We have web server in 7 lines of code! We do not need IIS as only one, right choice.
Of course we can do much more sophisticated things. Such as routing, WebAPI or even SignalR. You can also debug it easily.
More info about OWIN and Katana on ASP.NET website: An Overview of Project Katana
There is also screencast on Channel9: The Katana Project - OWIN for ASP.NET (it shows e.g. how to use WebAPI from 35:40).
Here is very nice article how to use SignalR with Katana.
Katana is Open Source and available on CodePlex.