OWIN – what is it about and why is it so cool?

image1564_thumb.png

 

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.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

About the author

Written by Code Inside Team

Learn more about our team.

Comment on this post

Recent Posts

  • Json-Online-Tools: Viewer & Json2Csharp generator

      Wherever APIs are mentioned the JSON format I not far away. Since I’m using two tools regularly I would like to introduce you to them. JSON Viewer If you only see the JSON-Text you are usually not able to see the structure. With the help of JSON Viewer you can have an easy overview: ...

  • Windows Phone SDK & „System“-Icons

      Although the Metro Design focuses a lot on Typography Icons are still quite important. If you install Windows Phone SDK you will receive 36 Icons. You can find them here: C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Icons Unfortunately many Icons you might know from the common applications are not integrated. Pedro Lamas extracted 99 additional Icons ...

  • image1830-570x194.png
    How can I figure out if my ADFS 2.0 works?

      I was working with ADFS 2.0 (“Active Directory Federation Services”) for a while when this simple question crossed my mind: How can I figure out if the connection between ADFS and AD “works”? Here is a simple test… What is ADFS? If you need some “position of trusts” beneath the AD-boarders you choose an ...

  • Subdomain vs. Subdirectory

      Better blog.mydomain.com or mydomain.com/blog? Good question! If got asked this question again via Twitter on the weekend so therefore I decide to share my experiences:   Choose a subdomain, if…. - You plan to offer “different services” which are “logical separated” on one domain - You are able to influence the subdomains without much ...

  • image1792-450x194.png
    Guide to Claim-Based Identity with the Access Control Service

    Microsoft published a free PDF about Claim-based Identity, Access Control Service and how to connect it to the remaining Microsoft world (Sharepoint, ADFS, Azure): Download-Link or MSDN Link I found the announcement today on the blog of Vittorio Bertocci. More information’s? If you want to get deeper into the subject you should risk a look ...

Support us