Welcome to MSDN Blogs Sign in | Join | Help

AddressAccessDeniedException – Cause and Solution

While working with WCF service on Windows Vista, I came across the following error, which I am sure everybody who have created the services on previous versions (Windows XP and likes) and trying to migrate their services to Windows Vista would have encountered.

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

The error occurs due to the new security settings in Windows Vista. Most people are no longer going to be running with Administrator privileges by default like they were doing on earlier platforms. This impacts your ability to run HTTP web services because listening at a particular HTTP address is a restricted operation. By default, every HTTP path is reserved for use by the system administrator. Your services will fail to start with an AddressAccessDeniedException if you aren't running the service from an elevated account. The account under which the Visual Studio and the debugger runs does not have the privilege (though the user account under which VS is runnig may be a part of Administrators group), and hence the error occurs. The plus sign in the URL just means that there's a wildcard being applied to the hostname.

To fix this problem, the owner of the HTTP namespace (built-in administrator) needs to delegate this ownership to the user account under which you are running your application (most of the times, it's the logged on user). To do this, start a command prompt using "Run as administrator" so that you have elevated privileges. Then, use netsh.exe to give some of the Administrator's HTTP namespace to your user account. You can look at the existing HTTP namespace delegations by using "netsh http show urlacl".

Now, use "netsh http add urlacl url=http://+:8000/ user=DOMAIN\UserName" to assign the HTTP namespace to required user account. You can get the syntax for all of these commands by running "netsh http" without any arguments. Note that I've matched the URL in this command to the URL that appeared in the error message. The wildcarding is important for getting the right reservation and you'll continue to be denied access if your reservation covers less than your service's attempted registration. Go back to Visual Studio and check that your service runs properly.

Published Monday, January 29, 2007 3:24 PM by Amit Lale
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Sunday, April 01, 2007 10:54 AM by Vadim

# re: AddressAccessDeniedException – Cause and Solution

Thanks.  It was very helpful.

Monday, June 04, 2007 2:43 AM by Pallavi

# re: AddressAccessDeniedException – Cause and Solution

I was running the WCF samples on Vista when I got the above exception.

All I did was, 'Run as Administrator'.

Thnx for the post

Wednesday, June 27, 2007 1:01 PM by Paul Wheeler

# re: AddressAccessDeniedException – Cause and Solution

FYI. The netsh tool isn't available in Windows 2003, and the alternative, httpcfg, is not very usable (you have to hand code SDDL strings). I've created a <a href="http://blogs.msdn.com/paulwh/archive/2007/05/04/addressaccessdeniedexception-http-could-not-register-url-http-8080.aspx">GUI tool/C# library to set HTTP Namespace reservations</a>, source is available.

Wednesday, June 27, 2007 1:02 PM by Paul Wheeler

# re: AddressAccessDeniedException – Cause and Solution

Thursday, November 22, 2007 11:32 AM by Ash

# re: AddressAccessDeniedException – Cause and Solution

The above solution works perfectly! The only thing that want to point out is the usage of command, "netsh http add urlacl url=http://+:8

000/ user=DOMAIN\UserName" . When I used my domain name and username, the command failed. When I used  "user=administrator" it worked.

Wednesday, February 06, 2008 2:04 PM by Rui

# re: AddressAccessDeniedException – Cause and Solution

Hi, i have a problem when i try to use the solution you presented it gives me an error. SDDL criation has failed. error 1332

Can you help on this one?

Thanks in advance.

Friday, February 08, 2008 12:13 AM by TGnat

# re: AddressAccessDeniedException – Cause and Solution

I got the error 1332 also.  I reran the command and used only the unsername, not the domain.  I guess that makes sense because my pc is not part of a domain?

Tuesday, March 18, 2008 3:46 PM by ReBitting

# WCF and Vista: AddressAccessDeniedException

WCF and Vista: AddressAccessDeniedException

Sunday, April 27, 2008 4:13 AM by ReBitting

# WCF e Vista: AddressAccessDeniedException

WCF e Vista: AddressAccessDeniedException

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker