2
I am trying to start a WCF as Windows service, but it returns me the following error:
HTTP could not register the URL http://+:80/. Your process has no access rights to this namespace (see website http://go.microsoft.com/fwlink/? Linkid=70353 for details).
How can I solve this problem, when it was a common executable, it worked perfectly, now as I am putting it as windows service, it keeps returning this error.
I’m doing it this way to start:
ServiceHost host = new WebServiceHost(typeof(Server));
WebHttpBinding binding = new WebHttpBinding();
binding.MaxReceivedMessageSize = 999999999;
ServiceEndpoint point = host.AddServiceEndpoint(typeof(IServer), binding, url);
point.Behaviors.Add(new WebHttpBehavior());
host.Open();
btnSalvar.Log(new string[1] { "CONECTADO" });
The problem is not the code, because as I already informed, it works on a common exe, the error happens after putting as windows service.
Is the Logon account in the service an account with permissions? You tried with an administrator account only to validate if the service starts?
– Ricardo Pontual
Yes the account is an administrator ..
– Mariana
Then it must be a problem to reserve the url+namepace+port. In the message link you have the commands to grant permission to the user who is running the service. For example in Windows Server 2008 forward or Windows 7 forward, the command is this:
netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\user
just put the login dominance you are using in the service– Ricardo Pontual
@Ricardopunctual I did so, but continues with the same mistake.
– Mariana