AddressAccessDeniedException: HTTP could not register URL http://+:8080/<…>.


A while back, when I was first doing WCF development I ran into the following exception:



AddressAccessDeniedException: HTTP could not register URL http://+:8080/<…>.  Your process does not have access rights to this namespace.


The exception message included a link to an MSDN article that explained the concept of HTTP Namespace Reservations. Unfortunately the page suggests using an outdated, and not very user friendly tool called HttpCfg.exe to set up the namespace reservations. Even more unfortunate is the fact that this tool requires the user to enter a Security Descriptor Definition Language (SDDL) string by hand. Now, while I do enjoy the fact that I can now consider myself a member of the relatively small club of people that can read and write SDDL strings, this was not something I was especially excited about taking time away from the project at hand to do. Unfortunately search for help on the internet yielded more hurt than help.


What Not To Do


Upon performing my internet search, I ran straight into Mark Michaelis’ post Windows Communication Foundation with Windows Vista and UAC. Now, generally speaking, I like Mark a lot, and he post a lot of good stuff on his blog. However, I am ethically opposed to what he is suggesting in his blog. Adding a manifest to your app to force elevation in Windows Vista is absolutely not what you should do! If you have a web serivce that has to run as Administrator then you are doing something wrong. In fact I hope you aren’t even running as an Administrator account when you’re developing (although aparently the Visual Studio team doesn’t agree with me).


What To Do


Option 1: If you’re on Windows Vista, you can use netsh. Nicholas Allen has details on his blog, as does Kenny Wolf.


Option 2: If you’re not on Vista, or you want to set permissions as part of the setup process, take a look at the source code Keith Brown has posted on his blog.


Option 3: If you want a GUI based on C# code similar to that on Keith’s blog, with a more flexible SDDL object model, then check out my tool, HttpNamespaceManager.


HttpNamespaceManager


This is not an official Microsoft tool, and should be considered sample code (see disclaimer below).


HttpNamespaceManager is available  as either source code or an executable (both are in the attached zip file). It is licensed under the creative commons attribution license and is free to use, modify, and redistribute for commercial or non-commercial purposes. The project is divided into an API for managing HTTP Namespaces, including an object model for ACLs and Security Descriptors, and a UI with automatic elevation in Windows Vista for operations that require administrative privledge.


Requires .Net Framework 3.0 to run. Visual Studio 2005 & .Net Framework 3.0 to build.


Http Namespace Manager


This screen shot shows the start page of the Http Namespace Manager. All of the actions (Add/Edit/Remove) require elevation. Double clicking an item is the same as clicking the Edit button. The Remove button removes the entry permanently and without confirmation, so use caution.


Http Namespace Manager - Add


When the Add button is clicked an input box is displayed in which the HTTP Namespace URL should be entered.


Http Namespace Manager - Edit


When the Edit button is clicked the following dialog is displayed. You must select a user or group in the top half of the form in order to set the permissions for it.


Disclaimer


THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

HttpNamespaceManager.zip

Comments (67)

  1. MichaelGiagnocavo says:

    Why does MS have this model for http.sys in the first place? You can bind a socket to an open port as a non-admin, you just can’t use the Windows http code to do.

    I can understand if your code is trying to use a port used by another application, and "hide" somewhere, i.e. http://server:80/secret/. But if you are doing a "full" bind to a port (i.e., "http://server:80/&quot;), then it should treat it as the same as if you just bound a socket to that port (and not allow any other apps to access that port either). What am I missing here? The only thing I can think of is that some firewalls might not be able to figure out that Malware.exe is listening to port 8080 and not http.sys.

    It is such a pain to have to deal with these ACLs. For WCF, we usually just don’t use HTTP bindings (since netTcp doesn’t have this issue). If we have to expose via HTTP outside of IIS, then yea, we make that app run as local admin. Sucks, but it’s more manageable than having to make sure every machine (development, testing, staging, production) has these ACLs.

  2. paulwh says:

    I agree that having to get these ACLs set up is a royal pain. Which is precisely why I posted this. I want to make it easier so that developers can do the “right thing” and not run as administrator. There are a lot of organizations where the run as admin requirement would be a deal killer. Does your project use an MSI for deployment to staging and production servers? How do you configure the service account in your deployments? If there were a standalone VBS script, or a custom action for an MSI to set the ACLs would you use it?

    Personally I don’t fully understand the rationale behind the HTTP reservation system, except that since http.sys does all multiple processes to bind to a single port with a different path, it makes some sense to allow applications to restrict who can use a particular URL. However I will forward your question on to some people and see if I can get you a more difinitive answer.

    Feel free to shoot me an email. sflanker (at) hotmail (dot) com.

  3. Sergiu says:

    I’m on Windows Vista and i tryed to use you’re tool but i get the same error. Any other methods to do that?

  4. Sergiu says:

    Nad now i get a SDDL string format exception

  5. Thank you for posting this Paul!

    Your HttpNamespaceManager tool let me get around a problem that’s been blocking me from running a WCF project that I’ve been working on.

    (Most of the project was developed on a machine running the dev environment as admin, but I ran into the access rights issue when I brought it into my more secured environment and was running visual studio as a regular user.)

    Just a note to anyone else making us of the tool…  I received unhandled exceptions trying to run the tool as an unprivileged user, but it worked fine when I ran is as an administrator (which makes perfect sense..).

  6. paulwh says:

    Sergiu, I’m sorry you’re having trouble getting the tool to work. I recommend you look at the source code to understand more of what’s going on. Or you could send me a exception message/stack trace of the exception you’re receiving and I can try and debug it. My email is sflanker (at) hotmail (dot) com.

    -Paul

  7. Idetrorce says:

    very interesting, but I don’t agree with you

    Idetrorce

  8. paulwh says:

    Idetrorce, do you mind elaborating on what you don’t agree with?

    -Paul

  9. The Trainer says:

    One time I was playing with some of the Hands-on-Labs of Visual Studio 2008 Training kit then I&#39;ve

  10. Sensbachtal says:

    Just wanted to say Hello to everyone.

    Much to read and learn here, I’m sure I will enjoy !

  11. Yesterday I presented to one of my financial services customers in the city on an overview of what’s

  12. Rui Covelo says:

    Your tool saved my day. I was getting "HttpSetServiceConfiguration completed with 87" when using httpcfg. I don’t have a clue what "87" means… I wasn’t even sure if this was a problem or not. With your tool, I easily added the missing url. Thanks!

  13. Bob W says:

    Thanks so much for posting this – absolutely and without doubt saved me hours of work.

  14. Chris D says:

    This Tool ROCKS!!!!!  Saved me from pulling out my few remaining hairs.  Thanks!

  15. Chad Knudson says:

    I ran your tool and got an exception in SecurityIdentityFromWellKnownSid with the call to LookupAccountSid returning a blank string.  I’m running on Windows XP SP2.

    I tried running the .exe you included in the .ZIP file as well as building and running under VS 2008.

  16. VistaSucks - Go Windows Server 2008 says:

    This tool works great on Windows Server 2008. Thanks for posting it.

  17. cruizer says:

    A project our team (in my employer) has been working on for a good number of months now makes extensive

  18. cruizer says:

    A project our team (in my employer) has been working on for a good number of months now makes extensive

  19. cruizer says:

    A project our team (in my employer) has been working on for a good number of months now makes extensive

  20. cruizer says:

    A project our team (in my employer) has been working on for a good number of months now makes extensive

  21. Pierre says:

    I was in an http Wcf endpoint hosted by a windows service scenario, stucked by the "HTTP could not register URL" error. Your post saved me.

    It works great on XP sp2 and Win 2003.

    Thank you.

  22. jester says:

    thanks bro’. great work. sorted me out straight away.

  23. Anonymous says:

    This tool doesn’t work under vista with the user logged in as a non-administrator

  24. Fatih Boy says:

    Thanks for your tool. When i try to run your application i got "Invalid ACE String Format" exception.

    So i just take a look at its source code. I would like to suggest following changes to make it culture invariant.

    File : AccessControlEntry.cs

    Line : 160

    From : Regex aceRegex = new Regex(aceExpr, RegexOptions.IgnoreCase);

    To   : Regex aceRegex = new Regex(aceExpr, RegexOptions.IgnoreCase|RegexOptions.CultureInvariant);

    File : Program.cs

    Line : 25

    From : Regex actionRegex = new Regex(@"(-|–|/)(?’action’ad?d?|ed?i?t?|re?m?o?v?e?)", RegexOptions.IgnoreCase);

    To   : Regex actionRegex = new Regex(@"(-|–|/)(?’action’ad?d?|ed?i?t?|re?m?o?v?e?)", RegexOptions.IgnoreCase|RegexOptions.CultureInvariant);

    File : AccessControlList.cs

    Line : 78

    From : Regex aclRegex = new Regex(AccessControlList.aclExpr, RegexOptions.IgnoreCase);

    To   : Regex aclRegex = new Regex(AccessControlList.aclExpr, RegexOptions.IgnoreCase|RegexOptions.CultureInvariant);

    File : SecurityDescription

    Line : 116

    From : Regex sddlRegex = new Regex(SecurityDescriptor.sddlExpr, RegexOptions.IgnoreCase);

    To   : Regex sddlRegex = new Regex(SecurityDescriptor.sddlExpr, RegexOptions.IgnoreCase|RegexOptions.CultureInvariant);

    Feel free to contact. fatih (at) enterprisecoding (dot) com.

  25. Dani says:

    one thing I don’t understand – my wizard created WCF project didn’t need to use this tool, a service that I’ve created from scratch had this rights problem.

    what MS do with the wizard that bypass this thing ?

  26. While working with WCF services over HTTP you may come across this error: HTTP could not register URL

  27. Todd says:

    Awesome utility.  Saved a lot o hairs from being pulled from my head.

  28. Bus tickets says:

    Why are they making so complicated for following just one sample code from someone. Almost all samples from MSDN talk about http://loca:8000 and then everyone is hit by the same error and there is no easy way to fix it.

    I tried to run your code on Windows XP3 and it is giving me Parameter is incorrect exception. It is letting me add the user, checks the box but once i click OK button it gives an exception.

    Thanks,

  29. Thomasek says:

    Hello everybody,

    thanks for a useful tool. I still get the "Parameter is incorrect" exception when trying to register an URL with containing star convention (e.g. http:///+.80/Test/). If I try to register a complete URI (http://localhost:80/Test/), the HttpNamespaceManager succeeds.

    I’m running Windows XP SP3. Have you found a solution for this?

    T

    Thanks,

    Tomas

  30. matt says:

    HttpSysConfig seems to be a better tool: smaller KBytes, fewer bugs and a better UI

    If you use HttpNamespaceManager, don’t delete all the entries! It screws the app up and you can’t add any/it crashes upon startup

  31. matt says:

    @thomasek:

    Your url:

    http:///+.80/Test/

    Has too many slashes after http and a period instead of a colon delimiting the host/port. Use HttpSysConfig instead; it’s more guided

  32. Joel says:

    HttpSysConfig has a big advantage over the tool available on this page, it runs in Windows XP.

  33. r701653 says:

    Hi,

    Your tool is great !

    But i want integrate it in a setup project so i want add a namespace using your lib.

    So,

    what are steps to add a new namespace without using WinForm ?

  34. rg701653 says:

    Ok, i didn’t read the option 2.

    Done

  35. Paulo Brito says:

    I’m running a Windows XP SP3, in a machine that’s, on the inside of, a company network domain, and as a consequence it’s under the company’s network

    policies. I’ve tried to host a "WCF Service" using a "Windows Service" running with the permissions of "NT AUTHORITYNetworkService" in this machine.

    I also tried to run the service in solo, it runs ok. But when I add the code for the:

    [C# code line 48] – host = new ServiceHost(typeof(PWCFService.PwService)); // this code line runs fine

    [C# code line 49] – host.Open(); // this code line throws the ERROR!!!

    The error is: "HTTP could not register URL http://+:8731/Design_Time_Addresses/PwService/. Your process does not have access rights to this namespace

    (see http://go.microsoft.com/fwlink/?LinkId=70353 for details)."

    This error does not go away. I already used the ‘httpcfg’ tool (trying all possible combinations of URL’s and permissions) after that I used the

    ‘HttpNamespaceManager’ app and still, no can do. In both cases I visualised the results of the tools using the command ‘httpcfg query urlacl’, and I

    realised that I was already able to obtain manually (with the ‘httpcfg’ tool) the same results as the ‘HttpNamespaceManager’ tool was getting.

    One example of the results are: ———————————————————–

     URL : http://+:8731/Design_Time_Addresses/

     ACL : D:(A;;GAGXGWGR;;;S-1-5-21-1246633644-337528824-2052957216-3235)(A;;GAGXGWGR;;;NS)

    ——————————————————————————————-

    And I’m still stuck with this error…

    {START – [[STACK TRACE]] }

      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.TransportChannelListener.OnOpen(TimeSpan timeout)

      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.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.NegotiationTokenAuthenticator`1.OnOpen(TimeSpan timeout)

      at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)

      at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

      at System.ServiceModel.Security.CommunicationObjectSecurityTokenAuthenticator.Open(TimeSpan timeout)

      at System.ServiceModel.Security.SecurityUtils.OpenTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout)

      at System.ServiceModel.Security.SecurityProtocolFactory.Open(String propertyName, Boolean requiredForForwardDirection, SecurityTokenAuthenticator

    authenticator, TimeSpan timeout)

      at System.ServiceModel.Security.SymmetricSecurityProtocolFactory.OnOpen(TimeSpan timeout)

      at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)

      at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

      at System.ServiceModel.Security.SecurityProtocolFactory.Open(Boolean actAsInitiator, 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.CommunicationObjectSecurityTokenAuthenticator.Open(TimeSpan timeout)

      at System.ServiceModel.Security.SecurityUtils.OpenTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, 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 System.ServiceModel.Channels.CommunicationObject.Open()

      at PWCFService.PwService.OnStart(String[] args) in C:Documents and SettingspbritoDesktopPWCFServicePWCFServicePwService.cs:line 49

    {END – [[STACK TRACE]] }

    Please can anyone help me…

  36. John says:

    I ran your tool and added a url but now it is throwing an exceptiong "Unable to Get Well Known SID" so the application doesn’t do anything anymore.

    I debugged it and it loops through all the available urls but never returns the table dictonary to the caller.

  37. John says:

    Now i cannot access my wcf services being hosted on IIS anymore. Help! I need this asap.

  38. Prashant says:

    Hey

    I downloaded your tool to cope up with the similar problem.

    The exe is throwing an exception "Unable to find SID"

    Could you please help..

    Regards

    Prashant

  39. Corey says:

    I downloaded this using Windows XP w/ SP2 and used it and it worked perfect.  Had to run this utility as a local admin, but after I set up my HTTP Namespace to grant my non-admin account EXECUTE permissions, my services ran fine.  

    Thanks, this is a very handy little utility!

    Corey

  40. ibram says:

    Hi,

    that’s a nice tool.

    Should I run it with elevated administrator permission?

    😛

    Regards,

    ibram

  41. Leah says:

    Thank-you for the tool – it made a complicated confusing issue disappear…. You made my Friday afternoon that much more pleasant 🙂

  42. Fiona Hughes says:

    Yep, 3 years on and this blog is still a sanity-saver, TY!

  43. Jon Bishop says:

    Ran this to sort "AddressAccessDeniedException" and it worked an absolute treat.

    This looked like it was going to take ages to sort so thanks so much for saving me hours!

    Cheers

    Jon

  44. Michael Lacy says:

    Just run VS as administrator and you will not have this issue.  This works in VS 2010 on Windows 7.

  45. Tamer says:

    thank you thank you for the tool, i just wanna say you solved  a problem when i was attempting to learn wcf, and implement the following simple example:

    http://channel9.msdn.com/shows/Endpoint/Endpoint-Screencasts-Self-hosting-WCF-Services/

    Thank you again.

  46. Mark says:

    This is awesome, just what I was looking for, I was considering making my own when all I found were examples of using the command line to add each namespace.

    Thanks.

    -Mark

  47. Thanks for sharing. It is very useful.

    Repeating same words from 'Bob W':

    "Thanks so much for posting this – absolutely and without doubt saved me hours of work."

  48. Scott says:

    For those having the problem with the "Well Known SID", I was having the same problem and couldn't figure out why.  I was using Windows 7 and used this utility a few months back and it worked, just opening it today to add another URL gave me the "Well Known SID" error and I couldn't manage my HTTP Namespaces.

    Doing a search on Google, you can use netsh to add and remove the HTTP Namespaces and avoid this buggy tool altogether.

    Example:

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

    Link:

    msdn.microsoft.com/…/ms733768.aspx

  49. I was wading through the netsh syntax and was about to try out this tool, but decided just to have my VS 2008 Run As Administrator (on Windows 7), this bypassed the error I received when my WCF service wanted to host itself in debug. Just FYI, this seemed an easier workaround for me for my purposes.

  50. xiaochen says:

    Looking for all manner of jersey: http://www.jersey-nba.com.

  51. siva says:

    I create WCF service library and i test that working fine on WCF Test client(default). when i host the WCF service in winodws service that time i got the error. I am using windows XP sp3, .Net 3.5 and Visual Studio 2008. i got error.

    Error opening host : HTTP could not register URL "http://+:8731/WCFServerDLL/Service1/.&quot; Your process does not have access rights to this namespace (see "go.microsoft.com/fwlink for details).

    the above link for microsoft i implement the httpcfg.

    Here i run the "httpcfg.exe set urlacl /u http://localhost:8731/WCFServerDLL/Service1/ /a"

    i get the result

    HttpSetServiceConfiguration completed with 87.

    what is the problem i got same error. can you give me a suggation.

  52. ivan says:

    I just want to thank you for this tool. it saved me a lot of time.

  53. Ben says:

    The download link does not work  anymore 🙁

  54. John says:

    I am unable to use the HttpNameSpaceManager utility. Reports an error 'Unable to get SID'

  55. shop nba jerseys says:

    cheap customized nba jerseys, cheap authentic nba jerseys, cheap wholesale nba jerseys.

    http://www.shopnbajerseys.com

  56. Dhananjay Kumar Sinha says:

    Hi Just got a msg when running this tool

    it was microsoft .net framework

    no SID found

    Deatils  are below

    <<< See the end of this message for details on invoking

    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************

    System.Runtime.InteropServices.ExternalException: Unable to Find SID

      at HttpNamespaceManager.Lib.AccessControl.SecurityIdentity.SecurityIdentityFromString(String sid) in C:UserspaulwhDocumentsVisual Studio 2005ProjectsUtilitiesHttpNamespaceManagerHttpNamespaceManagerLibAccessControlSecurityIdentity.cs:line 235

      at HttpNamespaceManager.Lib.AccessControl.AccessControlEntry.AccessControlEntryFromString(String aceString) in C:UserspaulwhDocumentsVisual Studio 2005ProjectsUtilitiesHttpNamespaceManagerHttpNamespaceManagerLibAccessControlAccessControlEntry.cs:line 160

      at HttpNamespaceManager.Lib.AccessControl.AccessControlList.AccessControlListFromString(String aclString) in C:UserspaulwhDocumentsVisual Studio 2005ProjectsUtilitiesHttpNamespaceManagerHttpNamespaceManagerLibAccessControlAccessControlList.cs:line 119

      at HttpNamespaceManager.Lib.AccessControl.SecurityDescriptor.SecurityDescriptorFromString(String sddl) in C:UserspaulwhDocumentsVisual Studio 2005ProjectsUtilitiesHttpNamespaceManagerHttpNamespaceManagerLibAccessControlSecurityDescriptor.cs:line 116

      at HttpNamespaceManager.Lib.HttpApi.QueryHttpNamespaceAcls() in C:UserspaulwhDocumentsVisual Studio 2005ProjectsUtilitiesHttpNamespaceManagerHttpNamespaceManagerLibHttpApi.cs:line 79

      at HttpNamespaceManager.UI.MainForm.MainForm_Load(Object sender, EventArgs e) in C:UserspaulwhDocumentsVisual Studio 2005ProjectsUtilitiesHttpNamespaceManagerHttpNamespaceManagerUIMainForm.cs:line 41

      at System.Windows.Forms.Form.OnLoad(EventArgs e)

      at System.Windows.Forms.Form.OnCreateControl()

      at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

      at System.Windows.Forms.Control.CreateControl()

      at System.Windows.Forms.Control.WmShowWindow(Message& m)

      at System.Windows.Forms.Control.WndProc(Message& m)

      at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

      at System.Windows.Forms.ContainerControl.WndProc(Message& m)

      at System.Windows.Forms.Form.WmShowWindow(Message& m)

      at System.Windows.Forms.Form.WndProc(Message& m)

      at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

      at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

      at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    ************** Loaded Assemblies **************

    mscorlib

       Assembly Version: 2.0.0.0

       Win32 Version: 2.0.50727.5446 (Win7SP1GDR.050727-5400)

       CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

    —————————————-

    HttpNamespaceManager

       Assembly Version: 1.0.0.0

       Win32 Version: 1.0.0.0

       CodeBase: file:///Z:/NameSpaceAdd/HttpNamespaceManager.exe

    —————————————-

    System

       Assembly Version: 2.0.0.0

       Win32 Version: 2.0.50727.5442 (Win7SP1GDR.050727-5400)

       CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

    —————————————-

    System.Windows.Forms

       Assembly Version: 2.0.0.0

       Win32 Version: 2.0.50727.5446 (Win7SP1GDR.050727-5400)

       CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

    —————————————-

    System.Drawing

       Assembly Version: 2.0.0.0

       Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

       CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

    —————————————-

    HttpNamespaceManagerLib

       Assembly Version: 1.0.0.0

       Win32 Version: 1.0.0.0

       CodeBase: file:///Z:/NameSpaceAdd/HttpNamespaceManagerLib.DLL

    —————————————-

    ************** JIT Debugging **************

    To enable just-in-time (JIT) debugging, the .config file for this

    application or computer (machine.config) must have the

    jitDebugging value set in the system.windows.forms section.

    The application must also be compiled with debugging

    enabled.

    For example:

    <configuration>

       <system.windows.forms jitDebugging="true" />

    </configuration>

    Suggest for this

  57. Suggest says:

    It is just what I’ve looking for and excited to read all the posts. I am looking forward to another great article from you.

    http://www.paylessnfljerseys.com Cheap NFL Jerseys

  58. BobTChicken says:

    Keith Brown's blog entry linked in your post seems to have been deleted. The Wayback machine has a copy here:

    web.archive.org/…/15632.aspx

  59. Scott Koland says:

    Awesome tool. Thanks. I also had to run an iisreset in order to get this to work for me.

  60. TLC says:

    Very nice, used it on windows 8 without any problems. easy peasy. tx alot!!

  61. It doesn't work for me (HttpNamespaceManager) on Windows 8, when I click on the Edit buttom, the application begins a strange behavior, openning and closing the forms quickly.

  62. Roberto says:

    Hi,

    we've ported your tool (particularly the HttpNamespaceManagerLib) to VS 2010 and used in one of our project. The program checks via HttpApi if it can be contacted on a particular port: if not it does elevation and adds it.

    the call is made in the Main() method with the following lines:

               HttpApi nsManager = new HttpApi();

               Dictionary<string, SecurityDescriptor> nsTable;

               nsTable = nsManager.QueryHttpNamespaceAcls();

    now: if I run the program from inside VS (both Debug/Release configurations) it works perfectly

    if I run the Debug exe from outside the VS IDE… it works

    it I run the Release exe from outside the VS IDE… it crashes

    the problem is in the return values of HttpQueryServiceConfiguration; when it works it returns a certain number of ERROR_INSUFFICIENT_BUFFER and a final ERROR_NO_MORE_ITEMS, when it crashes it returns a number of ERROR_NO_MORE_ITEMS (like a couple less than before) and a final code 6 (ERROR_INVALID_HANDLE?)

    Any idea anyone?

    thank you

    Roberto

  63. Maciek says:

    You know I am moving from Java RESTful (JAB-RS) to .NET development of RESTFul (both standalone and I prefer not to develop for IIS for now). I am shocked with this limitation having experience with this exception while I also developed standalone RESTFul service in Java that has ability to run as Windows Service on the same Windows host or standalone without need for some crazy administrative access. Promoting myself to admin to run RESTful as standalone because I just bind to a socket and I use DNS associated with Windows host? That must be very specific to ideas in Redmond. And yes in Java you can control authorization via JAAS separate module that is not part of OS madness. Geez where those ideas come from? App account is not supposed to be Admin account and that is security risk in itself in the first place.

  64. Maciek says:

    For the record. To run HTTP service on any Windows host  you should not need any tool to manage namespace unless you make conscious decision on security model for final (QA/PROD) deployments. Well apparently you do if you develop with .NET as decision is made for you already when you write first lines of code with WCF, but not with Java or anything that generates HTTP server  that needs host, domain and port (socket) to bind to. That's the first development environment that I work with since circa 1990 that requires these steps from developers. Lack of trust or forced security solution?

  65. Hossein says:

    Thank you very much for this brilliant easy tool you have made

  66. JDP says:

    Leonardo Fraietta, same here–failed for me and opened and closed quickly over and over (when i tried to add) and I had to restart the PC.

Skip to main content