Use the packet manager to install Microsoft.Owin.SelfHost
install-packet Microsoft.Owin.SelfHost
Code for a bare minimum HelloWorld web application running from a console window:
namespace HelloOwin
{
using System;
using Owin;
class Program
{
static readonly string baseUrl = "http://localhost:8080";
static void Main(string[] args)
{
using (Microsoft.Owin.Hosting.WebApp.Start<Startup>(baseUrl))
{
Console.WriteLine("Prease any key to quit.");
Console.ReadKey();
}
}
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Run(ctx =>
{
return ctx.Response.WriteAsync("Hello World");
});
}
}
}