Open Web Interface For .NET (OWIN)

Let us continue our journey with ASP.NET vNext. In the last couple of articles, we discussed:

This article explains the Open Web Interface For .NET (OWIN). OWIN is mainly categorized as middleware technologies.

Middleware is a computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glues". - Definition from Wikipedia.

OWIN is defined as a standard interface between .NET web servers and web application. It is community owned open source projects. It is just a specification, not an implementation. The Microsoft developed project “Katana” is on the top of OWIN.

Formerly .NET web applications very tightly integrate with IIS. It is initiated toward openness and open source to decoupled IIS dependency. This will support design and development .NET applications on non-Microsoft environment.

OWIN is not just decoupling web servers from .NET applications, but also offering support to features like self-hosting and authentication.

Let us create web applications using OWIN.

empty tamplet

We will install the required OWIN packages using Nuget.

OWIN

Install-package Microsoft.Owin.Host.SystemWeb –Pre.

package

We have successfully installed the required packages.

successfully installed

Let us add an OWIN startup class. The application will connect to the hosting environment using the startup class.

OWIN startup class

Let us add some sample code to the Startup class.

code

The web application is running on the OWIN server.

running
Let us add a console application to the same project to accomplish self-hosing using OWIN.

accomplish

Running the console application.

console application

Let us check the output in the browser.

output
We will have one more check using a Telnet Network command. We can check for port connectivity using the Telnet command.

command

network command

Reference