Wednesday, March 18, 2009

AddressAccessDeniedException – WCF services on Vista

I came across this exception HTTP could not register URL http://+:8080/.../. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). While working on Vista. The error occurs due to the new security settings in Windows Vista. Accounts running without Administrator privileges cannot 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, and hence the error occurs.
The problem can be fixed by delegating the ownership of the HTTP namespace to the user account under which the application is running. I found a very useful tool HttpNamespaceManager from Paul’s blog which utilizes the netsh command service to delegate the ownership of the namespace. Alternatively you can also run Visual Studio as Administrator to fix the issue.

No comments: