“A focused man working on a sticker-covered laptop in a coffee shop” by Tim Gouw on Unsplash

ASP NET WEB API SELF HOST IN WINDOWS SERVICE

Jérôme Cauchon
Vooban's tech stories
1 min readMay 8, 2016

--

We recently had to create an ASP Net Web API service that allowed us to search different databases. Our prototype was quite simple: it was self-hosted in an application console and everything worked well for local needs. As the client didn’t like the idea of having a console, we decided to self-host, but with a Windows service instead. We had quite a few problems with this. It was impossible for us to run the service and the Event Log errors didn’t allow us to detect the problem. After some research on the Net, I found an article explaining that you need to use the Netsh command in order to save an URL on an account. So now you’ll know what to do if this ever happens to you!

netsh http add urlacl url=http://+:8081/ user=machine\username

References : MSDN, Code Project

--

--