views:

50

answers:

3

i bet its pretty easy question , any way im trying to run a windows service which host WCF service in administrator mode!

i keep getting the exception of :

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)

i know its something has to do with the fact that windows doesnt start process services in admin mode but instead it start it in standard mode unless you specify the oppsite

any help on how to start it in admin mode ?

+1  A: 

i guess this

netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\user

fixed it but now i have a new exception any way i will look for the new exception and iw ill feed back if its something else.

Stacker
This is a better solution. This can be done in code (from an installer run in admin mode, for instance). See my answer.
spender
A: 

Add a manifest to the hosted WCF service with this phrase:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
rursw1
I'm not sure how applicable this would be to a Windows service. I wouldn't advise running it as admin.
spender
Anyway, this was the question.
rursw1
i did add that before but it didnt work , although i believe it should!
Stacker
+1  A: 

It would be inadvisable to run a service under admin mode simply to get an Url reservation on the Http pipeline. When you come to writing an installer, you can automate creation of the reservation in code. Here's a link that will help you: urlreservation.codeplex.com

spender