Building a Web API 2 project from scratch using OWIN/Katana .NET Part 3: hosting on Helios
July 9, 2015 Leave a comment
Introduction
In the previous post we discussed how to use OWIN host to self-host a Web API 2 application. We saw how easy and straightforward it was to install the OWIN hosting package with NuGet.
In this post we’ll look at another hosting option: Helios.
Project Helios
Microsoft has introduced a new project called Helios. You can read an elaborate introduction on the relevant MSDN blog page.
In short it is a project to completely remove the necessity of referencing the System.Web package from a .NET web application. Normally if you want to deploy your application on IIS then you’ll need to have System.Web in your list of references. In the previous post we saw how self-hosting is one way to get rid of that dependency.
Helios hosting is a more generic solution. The goal with that project is that you’ll be able to host your application anywhere without having to add System.Web to your project, even on IIS. Note that Helios is still in preview mode, it’s not final yet. It’s not even guaranteed that it will ever reach a production version. Therefore don’t use it in a real-life application.
Installation
Helios can be installed from NuGet but you have to enable packages in a pre-release state:
If everything goes fine then the Helios package should be installed. If you get the below error message…:
…then it means that you’ll have to update NuGet.
Go to the NuGet for VS2013 download page available here. Install the latest available version which was 2.8.60318.734 at the time of writing this post.
Restart Visual Studio after the installation and make sure you have the correct NuGet package manager installed under the Help, About Microsoft Visual Studio menu:
Try installing the Helios package again, it should succeed.
And that’s it really, you don’t need to do anything special after this. You can select to run the application on IIS and still remove the System.Web dependency. That is unless you use objects specifically from that package in which case you’ll need System.Web anyway. I don’t know what the future holds for System.Web but if Helios is “for real” then it might be broken up into separate Katana middleware to make .NET web applications leaner.
We’ll diverge from OWIN a little in the next post where we’ll add an asynchronous controller action to our demo app.
View the list of MVC and Web API related posts here.