Wcf – HTTP could not register URL http://+:10001/. Your process does not have access rights to this namespace

visual studio 2012wcfwindows 8

I just upgraded from Windows 7/VS2010 to a clean install of Windows 8/VS2012.
I'm logging onto a domain user (domain admin) and have started seeing this error when launching some of my wcf services from VS2012:

HTTP could not register URL http://+:10001/. Your process does not have access rights to this namespace

I've never experienced this before on Windows 7 and I'm a little perplexed why I'm seeing this now in Windows 8 (domain admin, user access control turned off).
With some research I found out that this error arises due to the VS process not running with admin rights and non admins apparently can't listen on TCP ports, however, I don't quite follow why VS wouldn't run as admin as the user I'm logging in to is a domain admin?

Best Answer

You must execute something like this:

netsh http add urlacl url=http://+:10001/YourUri/ user=\Everyone

or

netsh http add urlacl url=http://+:10001/YourUri/ user=DOMAIN\user

Something is mentioned in this article or google for "netsh http add urlacl"

AFAIK since Vista processes do not run with elevated privileges even if launched by Admin account. That is the whole point behind UAC.
However after you run netsh command you will not need anything like that anyway.

Related Topic