Last post Sep 05, 2014 04:09 AM by Shawn - MSFT
Sep 04, 2014 01:16 PM|amit_ask|LINK
I have written a simple WCF code. and want to host it . but when I run it shows me an exception.
"HTTP could not register URL http://+:8080/. Your process does not have access rights to this namespace"
I have a class library project, in which I have written my WCF code. then I added App.config file and write some codes.
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
<service name="DEMO1.HelloService" behaviorConfiguration="mexBehavior">
<endpoint address="HelloService" binding="basicHttpBinding" contract="DEMO1.IHelloService"></endpoint>
<endpoint address="HelloService" binding="netTcpBinding" contract="DEMO1.IHelloService"></endpoint>
<endpoint address="Mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
this is my Interface
public interface IHelloService
string GetMessage(string name);
and i implemented this
public class HelloService : IHelloService
public string GetMessage(string name)
return "Name : " + name;
then I added another console project to that solution and write code for Open Host
static void Main()
using(ServiceHost host=new ServiceHost(typeof(DEMO1.HelloService)))
Sep 04, 2014 02:03 PM|ankit.sri|LINK
You may want to run the following command with correct access rights with you WCF URL.
netsh http add urlacl url=http://+:8080/MyUri user=DOMAIN\user
Sep 04, 2014 02:45 PM|ganeshmk|LINK
You need administrative privileges to your account if you are running in local network or open visual studio in 'Run as administrator' mode.
Sep 05, 2014 04:09 AM|Shawn - MSFT|LINK
For this situation, about this error message, you could try the following steps:
Right click on visual studio, click on “Run as Administrator”, then Run the application again.
The error occurs due to the new security settings. 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.
For more information: