Just a little project. I had real trouble getting this working so here's an example of it.
Either clone the repo or just copy the bits you need.
.NET Framework 4.61 or up, OWIN, Topshelf, Unity, Topshelf.Unity
This project is licensed under the MIT License, not that it needs to be.