WCF ServiceHost access rights

C#WcfWindows 7

C# Problem Overview


I get the following error when going through the WCF tutorial.

HTTP could not register URL http://+:8000/ServiceModelSamples/Service/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

Is this something caused by a restriction on Windows 7?

C# Solutions


Solution 1 - C#

The issue is that the URL is being blocked from being created by Windows.

Steps to fix: Run command prompt as an administrator. Add the URL to the ACL

netsh http add urlacl url=http://+:8000/ServiceModelSamples/Service user=mylocaluser

Solution 2 - C#

If you are running via the IDE, running as administrator should help. To do this locate the Visual Studio 2008/10 application icon, right click it and select "Run as administrator"

Solution 3 - C#

Another solution is to use the address

http://localhost:8732/Design_Time_Addresses/YOUR_ADDRESS .

.NET Framework (3.5) automatically register this address (http://*:8732/Design_Time_Addresses) for debugging scope. This is useful when you need to host services inside visual studio for debugging or testing. Don't use this on production...

Solution 4 - C#

Open a command prompt as the administrator and you write below command to add your URL:

netsh http add urlacl url=http://+:8000/YourServiceLibrary/YourService user=Everyone

Solution 5 - C#

Open Visual Studio as an Administrator.. It will run.

Solution 6 - C#

Other option that work is ..,

If you change de indentity in application pool, you can run the code, the idea is change the aplication pool execution account for one account with more privileges,

For more details use this blog

https://letrasandnumeros.com/2017/11/27/http-could-not-register-url-http-80-hellowcf-your-process-does-not-have-access-rights-to-this-namespace/

Solution 7 - C#

I am working on Windows Vista. Even i faced the same problem but when i tried to run VS 2008 with administrative privileges, the issue resolved and my service was up and running. :)

Solution 8 - C#

Running Visual Studio as administrator could fix the issue, but if you use Visual Studio with for example TortoiseSVN, you cannot commit any changes. Another possible solution would be to run the service as administrator and the rest Visual Studio as local user.

Solution 9 - C#

please open your Visual Studio in Administration Mode then try it.

Solution 10 - C#

Please open your Visual Studio as administrator:

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJoshuaView Question on Stackoverflow
Solution 1 - C#JoshuaView Answer on Stackoverflow
Solution 2 - C#Stephen NewmanView Answer on Stackoverflow
Solution 3 - C#Davide IcardiView Answer on Stackoverflow
Solution 4 - C#Metin AtalayView Answer on Stackoverflow
Solution 5 - C#VickyView Answer on Stackoverflow
Solution 6 - C#LucasetoView Answer on Stackoverflow
Solution 7 - C#Anitesh Kumar.View Answer on Stackoverflow
Solution 8 - C#DoroView Answer on Stackoverflow
Solution 9 - C#PalnatiView Answer on Stackoverflow
Solution 10 - C#lalitView Answer on Stackoverflow