Search code examples
wcfsslself-hostingnetsh

Self-Hosted WCF - Namespace Reservation required?


I'm running a Self-Hosted WCF Service (SSL). I've seen that other people use netsh to do a namespace reservation for their Self-Hosted WCF by doing something like that:

netsh http add urlacl url=https://+:80/MyUri user=DOMAIN\user

My webservice works without that Namespace Reservation. So is there any reason to do that? Am I missing something? Why would I do that namespace reservation?

MSDN: Configuring HTTP and HTTPS


Solution

  • Because you're running the code as an administrative user. Any restricted user won't be able to host an HTTP server on port 80, or any port for that matter, without having the URL registered to their account.

    See Why won't my Windows Service that is hosting a WCF Service run under LocalService or NetworkService accounts, WCF Service Access right: No access rights to this namespace.