12 June 2012 CI Team

 

OWIN stands for “Open Web Interface for .NET” and it is a specification for the communication between .NET Web Server and Web applications.

.NET Web Server – did you mean the IIS?

A highlight at first: there are several other .NET Web Server. Of course IIS is the one we usual use but at the same time it is a very “tough” application.

OWIN – Big Picture

Louis DeJardin, a Microsoft employee in the ASP.NET team created this little picture to show the connection between OWIN and his OWIN-sandbox project. There is also a fantastic blogpost which I’m going to repeat in parts.

 

image

Let’s take a deeper look to the several parts:

Katana.exe is a kind of “sandbox” for the whole Webstack.

First blue box with “server.dll”, “Kayak”, “HttpListener”: These are the different “Web Server”. The server.dll represents what we already know from IIS. The HttpListener is also an operation system / Framework components and was often used in the WCF and WebApi world before. Kayak instead is a .NET Web Server written in C# (!).

The orange line: That’s what OWIN describes. What follows is the “Middleware” later in the Code you are going to find it in the Namespace “Gate”.

At the end of the pipeline there are some Web Frameworks for example NancyFx or the WebApi. Also SignalR is “OWIN” compatible.

OWIN Sandbox Project

As far as I can tell from my researches this project is the easiest way to enter the OWIN universe.

image1566The download includes a solution with several Web-projects and different ways to use OWIN.

If you start the projects from the Visual Studio there aren’t any big surprises waiting for you.

Now Katana enters the game:

After you’ve downloaded Katana (maybe from Chocolatey) the magic begins:

cinst katana
git clone https://github.com/owin/owin-sandbox.git
cd owin-sandbox\src\Case05_JustNancy
msbuild
katana --server kayak

(The MSBuild order only works when you register the program in the Powershell or when it comes from the VS Shell).

With the following order we allow Katana to create a Kayak Server – and voila:

image

image

Without the use of IIS Express, Cassini or HttpListener we are able to use NancyFx!

Hint: Visual Studio instances need to be closed – otherwise there seem to be some conflicts with the connection to Socket.

Freedom offers creativity

Actually I don’t know where I can use this at the moment but other frameworks already work with it – especially in the ruby world and inspired several Web frameworks. The freedom is able to inspire some fresh and interesting constellations and is also followed by the Microsoft ASP.NET team. Cool isn’t it? ;-)

Additional Links

Of course Hanselman already blogged about it and recorded a Podcast with the creator of Kayak.

You will find an OWIN wiki on GitHub with some more information’s and outlooks.