Last post Sep 19, 2017 09:18 AM by rayhan.dimikit
Sep 16, 2017 04:49 PM|rayhan.dimikit|LINK
I have created a simple wcf service. I have already debug the wcf service separately, it's okay then. I have hosted it by a windows service. But when I install the windows service in my computer and tried to start the windows service, it can't be start.
It's getting the following exception.
Service cannot be started. System.ServiceModel.AddressAccessDeniedException: 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). ---> System.Net.HttpListenerException:
Access is denied
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelListener`1.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan ...
Although I have started my visual studio as an administrator and also the visual studio developer command window during the service installation. I have also register the base address of the service by using the command "netsh http add urlacl url=http://+:8080/MyUri
user=DOMAIN\user". None of those process can't solve the exception. Please suggest me a way to solve the exception.
Sep 17, 2017 10:38 PM|DA924|LINK
Although I have started my visual studio as an administrator
How did you do that? If you didn't set the VS short-cut to 'run as administrator' and got the UAC prompt, then VS is not running with admin rights.
I would say that the Windows service in not using an user account that has admin rights and/or Windows service is not using a UAC manifest that specifies run wit admin rights.
Sep 18, 2017 02:19 AM|Edward Z|LINK
>> But when I install the windows service in my computer and tried to start the windows service, it can't be start.
Which account did you use in Service Installer Properties pane?
I suggest you check whether you run windows service under “DOMAIN\user”.
Sep 18, 2017 10:32 AM|rayhan.dimikit|LINK
I have already started the VS 'run as administrator' from the VS short-cut and the VS is running with admin rights. Beside this also added an Application Manifest File in the peoject and force the application to run with admin previllage but don't
overcome the problem yet.
Sep 18, 2017 10:39 AM|rayhan.dimikit|LINK
I have used LocalSystem account in ServiceProcessInstaller properties pane and also my windows service is running under "DOMAIN\user".
Sep 18, 2017 03:06 PM|DA924|LINK
Sep 19, 2017 08:23 AM|Edward Z|LINK
Could you share us your demo project solution and detail steps to produce your issue? We will try to reproduce your issue based on provided information.
I suggest you run below command to check whether netsh add url correctly.
netsh http show urlacl
Sep 19, 2017 09:18 AM|rayhan.dimikit|LINK
Thanks Edward. The issue is solved. There was a mismatch of account between ServiceProcessInstaller and where the windows service was running.