170

I get the following error when going through the WCF tutorial.

HTTP could not register URL http://+:8000/ServiceModelSamples/Service/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

Is this something caused by a restriction on Windows 7?

2

9 Answers 9

183

The issue is that the URL is being blocked from being created by Windows.

Steps to fix: Run command prompt as an administrator. Add the URL to the ACL

netsh http add urlacl url=http://+:8000/ServiceModelSamples/Service user=mylocaluser
6
  • 4
    Glad you fixed that. What did the "+" mean? May 20, 2009 at 1:29
  • I have a hunch that it means a generic local IP.
    – Joshua
    May 20, 2009 at 11:22
  • 12
    Note: You pretty much have to enter url=http://+:port/path exactly. url=address:port/path did not work for me, as you would think it might. Also note that you have to use the network server as your user ("NT AUTHORITY\NETWORK SERVICE", if that's what your service's installer is set to. Jun 15, 2010 at 1:58
  • 10
    Any way yo do this without needing an Administrator access?
    – setzamora
    Sep 10, 2012 at 10:49
  • 1
    using my account for the user didn't work. Worked with user=Everyone
    – Kim
    Nov 20, 2014 at 6:38
91

If you are running via the IDE, running as administrator should help. To do this locate the Visual Studio 2008/10 application icon, right click it and select "Run as administrator"

4
  • 22
    Not really a 'much better' solution @Liam - administrator privileges in a dev environment in a corporate setup could give you many more permissions to do dangerous things. A much easier solution, sure, but with power comes responsibility ...
    – Unsliced
    Jul 10, 2012 at 9:02
  • 2
    Original solution also required execution as administrator - granted for a smaller period of time, and of course you need to be aware what you are doing from a security context. Jul 11, 2012 at 15:03
  • 1
    so, anyway to do this without admin privileges?
    – setzamora
    Sep 10, 2012 at 11:59
  • Perfect. I was running a program from IDE that needed to register a URL on another machine and running as administrator worked perfectly. Aug 8, 2016 at 21:22
36

Another solution is to use the address

http://localhost:8732/Design_Time_Addresses/YOUR_ADDRESS .

.NET Framework (3.5) automatically register this address (http://*:8732/Design_Time_Addresses) for debugging scope. This is useful when you need to host services inside visual studio for debugging or testing. Don't use this on production...

4
  • 1
    Some sites refer to port 8731 instead of 8732. Aug 6, 2012 at 12:31
  • 1
    @DaviFiamenghi As long as .net 3.5 is installed it should work. But I never tried. Usually I consider a test like this an integration test so I don't run it on TFS, I only run unit tests on TFS. Jun 26, 2013 at 22:25
  • @NenadDobrilovic Mine uses 8733 :). But that is not important.
    – Hooch
    Sep 10, 2014 at 9:05
  • 1
    Our server is using localhost:8733/Design_Time_Addresses and I'd have never known to look for it without your answer, thanks. Also, Bob's tool showed all of the addresses that were permissioned - that's how I discovered it was 8733. Thanks
    – Lee Oades
    Nov 13, 2014 at 15:18
31

Open a command prompt as the administrator and you write below command to add your URL:

netsh http add urlacl url=http://+:8000/YourServiceLibrary/YourService user=Everyone
0
3

Open Visual Studio as an Administrator.. It will run.

3
  • I had the same problem with nunit-gui. Ran as administrator, all good.
    – Valamas
    Nov 17, 2013 at 23:36
  • I have the same problem vs 2013 and running as admin doesn't work
    – ZoomVirus
    Sep 22, 2014 at 9:46
  • why i need admin why can't i run as standard user?
    – Marcer
    Apr 3, 2018 at 21:19
0

Other option that work is ..,

If you change de indentity in application pool, you can run the code, the idea is change the aplication pool execution account for one account with more privileges,

For more details use this blog

https://letrasandnumeros.com/2017/11/27/http-could-not-register-url-http-80-hellowcf-your-process-does-not-have-access-rights-to-this-namespace/

-2

I am working on Windows Vista. Even i faced the same problem but when i tried to run VS 2008 with administrative privileges, the issue resolved and my service was up and running. :)

-2

Running Visual Studio as administrator could fix the issue, but if you use Visual Studio with for example TortoiseSVN, you cannot commit any changes. Another possible solution would be to run the service as administrator and the rest Visual Studio as local user.

-3

Please open your Visual Studio as administrator:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.