Access Denied on Windows #85
-
Hi, I am trying to start a server on a specified port by clearing and adding prefix, but I got Access Denied when invoking server.Run(). the exception does not occur if i commented out the prefix clearing and adding prefix part. What is the cause of Access Denied? Did i miss anything? Thanks in advace. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Can you post some code? |
Beta Was this translation helpful? Give feedback.
-
Access DeniedWhen you try to run your server for the first time, you might see an Access Denied exception occur. While annoying, this is rather easy to overcome. If you want to use HTTP.SYS to listen on a URI, you either need administrative privileges or an administrator that reserves the URI for normal users. Run As AdministratorFor development purposes, assuming you are an administrator on your Widows instance, you can simply run Visual Studio as administrator. Likewise, you can run the Windows command line as administrator if you want to test it outside of Visual Studio. Configure Namespace ReservationsFor obvious reasons, counting on your application running as administrator in production is unwise. In these instances, you'll want to configure a namespace reservation. This reservation can be made by using the $ netsh http add urlacl url=http://+:1234/ user=DOMAIN\user This can be done programatically, but the implementation is outside the scope of Grapevine. It's important that the value of the server.Prefixes.Add("http://+:1234/"); See the documentation for the |
Beta Was this translation helpful? Give feedback.
Access Denied
When you try to run your server for the first time, you might see an Access Denied exception occur. While annoying, this is rather easy to overcome. If you want to use HTTP.SYS to listen on a URI, you either need administrative privileges or an administrator that reserves the URI for normal users.
Run As Administrator
For development purposes, assuming you are an administrator on your Widows instance, you can simply run Visual Studio as administrator. Likewise, you can run the Windows command line as administrator if you want to test it outside of Visual Studio.
Configure Namespace Reservations
For obvious reasons, counting on your application running as administrator in pro…