Katana and OWIN for ASP.NET, what are they?

Posted: (EET/GMT+2)

 

If you've worked with ASP.NET web development, you might have heard the terms Katana and OWIN. These two terms both refer more or less to the same thing: Katana has evolved from an open-source project OWIN, or "Open Web Interface for .NET".

But, the above doesn't tell much what Katana and OWIN are, does it? Indeed, no. So here's the takeaway: Katana (and OWIN, from which it originated) allows ASP.NET web applications to work better in the cloud by allowing better scaling, flexibility, and performance. So you could think it as a "cloud-enabled", just like ASP.NET MVC enabled better structure and testability to ASP.NET WebForms applications. Katana is the Microsoft-supported release of OWIN, both of which are still open-source.

How do you get started with Katana, then? Firstly, Katana can be installed to an ASP.NET web application using a NuGet package. (It's worth noting that the new Visual Studio 2013 has nice built-in support for Katana.) Then, you start programming with Katana, which is different to what you've used to with ASP.NET Web Forms, MVC or Web API.

The Hello World example would look something like this:

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

For more information about the possibilities, see this ASP.NET article. There's also a similar article on Katana in a recent MSDN Magazine issue.