locked
Your process does not have access rights to this namespace ...? RRS feed

  • Question

  • Hi,

    I have deployed my WCF service and trying to run it,,,and I am meeting this error at---
     X509Certificate2 cert = new X509Certificate2(cerBytes,<my pwd>,X509KeyStorageFlags.MachineKeySet);

    I instantiated host as --
    ServiceHost host = new ServiceHost(typeof(CalculatorService), new Uri("http://grspmc.cloudapp.net/CalculatorService"));

    I got exception when I run it---


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

    -- at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen() at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener) at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.DatagramChannelDemuxer`2.OnOuterListenerOpen(ChannelDemuxerFilter filter, IChannelListener listener, TimeSpan timeout) at System.ServiceModel.Channels.SingletonChannelListener`3.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelListener`1.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecuritySessionSecurityTokenAuthenticator.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout) at System.ServiceModel.Security.SecuritySessionServerSettings.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelListener`1.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at ACSCloud_WebRole._Default.OpenHost() in C:\Program Files\Microsoft .NET Services SDK (March 2009 CTP)\Samples\AccessControl\ACSCloud\ACSCloud_WebRole\Default.aspx.cs:line 104

    I tried the netsh command but it didnt work.

    Thanks,
    Prashant Phalle
    • Changed type Prashant Phalle Friday, June 19, 2009 6:23 AM
    • Moved by DanielOdievich Tuesday, September 28, 2010 9:07 PM forum migration (From:Windows Azure AppFabric)
    Monday, April 27, 2009 8:14 AM

Answers

All replies

  • Hi,

    Anybody aware of such scenario ?
    Kindly reply ASAP.


    Thanks,
    Prashant.
    Monday, April 27, 2009 1:08 PM
  • Hi Prashant,

    If you follow the provided link - http://go.microsoft.com/fwlink/?LinkId=70353.  It will provide instruction on using httpcfg.exe or netsh.exe to provide permission for your credential to reserve http url namespace on your local machine.

    Jenny
    • Proposed as answer by Jenny Lo Monday, April 27, 2009 9:21 PM
    • Proposed as answer by Emerson Simette Monday, September 24, 2018 4:26 PM
    Monday, April 27, 2009 9:21 PM
  • Hi Jenny
    Thanks for reply. 
    It works for me i.e. returns public key .. http://34c7bbbd-954c-4bc9-97b0-0711872aa34b.cloudapp.net/Default.aspx
    As I said earlier, I tried the netsh command but it didnt work. I used the HttpNamespaceManager.exe downloaded.
    Here is the code for it --
      ServiceHost host = new ServiceHost(typeof(CalculatorService), new Uri("http://grspmc.cloudapp.net/CalculatorService"));
                    String solutionName = <my solution>;
                    ServiceCredentials sc = host.Credentials;
    
                    X509Certificate2 cert = new X509Certificate2(cerBytes, <my PWD>,X509KeyStorageFlags.MachineKeySet);
                    Label1.Text ="Public key ="+ cert.GetPublicKeyString();
    
                    sc.ServiceCertificate.Certificate = cert;
                    CalculatorServiceCredentials serviceCredential = new CalculatorServiceCredentials(solutionName);
                    serviceCredential.ServiceCertificate.Certificate = cert;
                     host.Description.Behaviors.Remove((typeof(ServiceCredentials)));
                    host.Description.Behaviors.Add(serviceCredential);
                    
    
                    host.Open();



    Error encounters when a host opening method is called ---

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

    -- at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen() at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener) at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.DatagramChannelDemuxer`2.OnOuterListenerOpen(ChannelDemuxerFilter filter, IChannelListener listener, TimeSpan timeout) at System.ServiceModel.Channels.SingletonChannelListener`3.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelListener`1.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecuritySessionSecurityTokenAuthenticator.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout) at System.ServiceModel.Security.SecuritySessionServerSettings.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelListener`1.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at ACSCloud_WebRole._Default.OpenHost() in C:\Program Files\Microsoft .NET Services SDK (March 2009 CTP)\Samples\AccessControl\ACSCloud\ACSCloud_WebRole\Default.aspx.cs:line 104

    Kindly reply.

    Thanks,
    prashant phalle
    Tuesday, April 28, 2009 4:31 AM
  • Please reply ASAP if anybody aware of it.


    Prashant.
    Tuesday, April 28, 2009 5:26 AM
  • Sorry for not responding to the other thread. I'm also not able to solve this problem at this time. There're a lot of obstacles to get ACS to work on Windows Azure. This time, the exception throws because even with full trust, your application is running under a standard Windows account without administrator privilege. So even if you spawn a process to start netsh, without elevation, you cannot grant yourself the rights to listen on those ports. I'm still investigating if there're any workarounds.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, April 28, 2009 8:32 AM
  • Thanks for responding.

    Prashant.
    Tuesday, April 28, 2009 8:35 AM
  • Hi Luo,

    May I know any updates regarding this ?


    Thanks,
    Prashant.
    Monday, May 11, 2009 6:34 AM
  • Hi,

    Donnt run this service from Vs,In win 7 or vista go to bin\debug folder and run application EXE  as administrator(right click and select "Run as Administrator "), this process will run under administrator,

    Now run the exe and Put your service URl in explorer like: http://localhost/ServiceModelSample/service

    this works

    Sunday, May 31, 2009 8:17 AM
  • Hi,

    you can do this through VS also,in win 7 or vista Run Visul Studio in admin mode, right click on the visual studio EXE and select "Run as Administrator "

    usually you can find Visual Studio EXE on the Location: "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" for vs 2008
    and "C:\Program Files\Microsoft Visual Studio 8.0\Common7\IDE\devenv.exe" for VS 2005
    • Proposed as answer by Sam Net Tuesday, January 10, 2012 10:05 PM
    Sunday, May 31, 2009 8:29 AM
  • Hi Samar,
    Thanks for reply.

    I think some misinterpretation of the problem is there.
    I am getting the error might be because I am accessing the certificate stored in the blob.
    And I have created the application with the Administrator rights applied for VS.


    Thanks,
    Prashant.

    Monday, June 1, 2009 9:10 AM
  • Anybody gone through such issue/ implemented ACS for cloud application without Geneva framework/LiveID ?


    Prashant.
    Friday, June 19, 2009 5:58 AM
  • Should I give up working on this scenario as nobody having inputs on this?


    Prashant.
    Monday, June 22, 2009 8:01 AM
  • Hello Prashant,

    Here is the solution to your problem...Sorry for late response. I had the same problem on my machine. But after turning off the UAC settings, WCF service is working fine....

    http://mark.michaelis.net/Blog/WindowsCommunicationFoundationWithWindowsVistaAndUAC.aspx

    Hope this helps.
    Mahesh Chaudhari
    Friday, January 15, 2010 7:19 AM
  • Prashant et al,

    If you see ahead of the StackTrace our address access denied exception (below) and are running (Vista || or higher) and are trying to host the service locally:

    System.ServiceModel.AddressAccessDeniedException was unhandled
      Message=HTTP could not register URL http://+:8080/HelloWorldService/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).
      Source=System.ServiceModel

    {

    Sanity Check: Make sure you're running Visual Studio as an Administrator.  Right click the Visual Studio icon prior to starting it, and "Run as administrator".

    Despite turning off UAC is a quick answer and may save on some annoyances, I would respectfully advise the alternative: make it so Visual Studio runs every time as administrator.  Drill into the properties of the "devenv" Application type file (opening the respective file location of which you can snag from your VS process in your Task Manager), choose the "Compatibility" tab in the Properties window, and check in the "Privilege Level" group's "Run this program as administrator".  Benefits are: you'll never forget to run VS as administrator after this, and avoid changing the local security policy on your entire machine.

    }

    -SCL


    • Edited by Sean Leavitt Monday, December 26, 2011 11:00 PM
    • Proposed as answer by Sean Leavitt Monday, December 26, 2011 11:02 PM
    Monday, December 26, 2011 10:58 PM
  • Thanks, work for me
    Tuesday, January 10, 2012 10:06 PM
  • here's da fix, needs to run as admin from a dos prompt

    netsh http add urlacl url=http://+:80/CalculatorService.svc user=DOMAIN\user

    Wednesday, August 8, 2012 2:02 AM
  • I started VS2010 (Devenv.exe) as Administrator. It did not given me any error.

    Just right click on VS2010 and select Run as Administrator.

    Below commands also helps.

    netsh http add urlacl url=http://+:80/CalculatorService.svc user=DOMAIN\user

    NETSH HTTP ADD URLACL URL=http://+:8000/ USER="NT AUTHORITY\LOCAL SERVICE"


    Thank you, Regards, Srigopal


    Saturday, December 29, 2012 2:59 PM
  • To run VS2010 (Devenv.exe)  as Administrator always, follow the below settings.

    Right click on devenv.exe and select properties and select advanced and check run as administrator option.

    Note: To ensure your .sln is running under Admin mode. Open DevEnv.exe (after applying above settings) and then open your .sln file. 


    Thank you, Regards, Srigopal

    Saturday, December 29, 2012 3:14 PM
  • Hi Prashant,

    Reopen your Visual Studio with ->RUN AS AN ADMINISTRATOR OPTION. The issues gets resolved automatically.

    Hope this helps

    Friday, May 18, 2018 8:48 AM
  • Thank you Prashant. HttpNamespaceManager immediately helped me to be up and running
    Friday, July 19, 2019 6:15 AM