-
Notifications
You must be signed in to change notification settings - Fork 333
Hello World
These instructions will help you set up an Katana based project and then author and deploy an Katana based app. For additional samples see these docs.
In VS 2015:
From the menu, click: File -> New -> Project...
In the new project dialog, select: Installed -> Templates -> Visual C# -> Web
Choose: ASP.NET Empty Web Application
Install the OWIN System.Web adapter:
- Right-click on the project and select Manage Nuget Packages
- Select Online, and optionally Include Prerelease
- Search for
Microsoft.Owin.Host.SystemWeb
and press Install - Also search for
Microsoft.Owin.Diagnostics
and install it.
Create a Startup class: Right-click on the project and select Add -> Class... Select Installed -> Visual C# -> Code -> Class and name it Startup.cs
Add using Owin;
at the top of the file. Then add the following method in the Startup class:
public void Configuration(IAppBuilder app)
{
app.UseWelcomePage();
}
You can now "F5" to run and should see a simple welcome page running on System.Web (ASP.NET).
These instructions will help you install and run an OWIN HttpListener server using Chocolatey and Katana.
Start with the same application you wrote above.
To install Chocolatey http://chocolatey.org/ run the following from the command line:
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://bit.ly/psChocInstall'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
To install OwinHost.exe, run:
cinst OwinHost -pre
Run the self-host app:
Open an CMD prompt
CD into the base directory of your web app
And run:
OwinHost
Browse to the default url: http://localhost:5000/