We are going to create a new self-hosted website using owin.
- Visual Studio 201x (I am using the VS 2015) in "Run as Administrator" mode (required to open ports).
- Internet connection (assumed that you have it since you are reading this post).
1) Create a new Console application:
2) Install the Owin packages:
Open the Package Manager Console by clicking the Tools menu and going to Tools/Nuget Package Manager/Package Manager Console
Execute the following command:
It will install the Owin libraries to reference them in your project.
3) Configure the application to host the web:
Add the following content to the Program.cs class:
On top of usings:
Above the namespace declaration:
Add the Startup class :
public class Startup
public void Configuration(IAppBuilder app)
context.Response.ContentType = "text/plain";
return context.Response.WriteAsync("Hello, world.");
Add the content to the body of the Main method:
static void Main(string args)
Console.WriteLine("Press [enter] to quit...");
4) Check it!
Press F5 to execute the Console Application in Debug mode.
5) Further information: