HttpListenerException (0x5): Access is denied (Support #148)

Added by Gert-Jan Naaktgeboren about 4 years ago. Updated almost 4 years ago.

Status:Assigned Start date:07/30/2014
Priority:Normal Due date:
Assignee:Daniel Nauck % Done:


Target version:-



I've downloaded the license manager from github ( opened the solution in VS2013 and was able to build it.
Next I deployed it to our webserver (Windows 2008 R2, IIS7).

When I now go to the site I get the error HttpListenerException (0x5): Access is denied.

[HttpListenerException (0x5): Access is denied]
System.Net.HttpListener.AddAllPrefixes() +335
System.Net.HttpListener.Start() +680
Raven.Database.Server.HttpServer.StartListening() +1058
Raven.Client.Embedded.EmbeddableDocumentStore.InitializeInternal() +1250
Raven.Client.Document.DocumentStore.Initialize() +1055
License.Manager.Core.AppHost.ConfigureRavenDb(Container container) +144
License.Manager.Core.AppHost.Configure(Container container) +850
ServiceStack.WebHost.Endpoints.AppHostBase.Init() +304
License.Manager.Global.Application_Start(Object sender, EventArgs e) +87

[HttpException (0x80004005): Access is denied]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12951237
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Access is denied]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12968244
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12807949

What am I doing wrong.


Updated by Gert-Jan Naaktgeboren about 4 years ago

I've found the solution.

The code in AppHost.cs method ConfigureRavenDb, i've changed the UseEmbeddedHttpServer from true to false.
Is that the way to go?

public void ConfigureRavenDb(Container container)
var documentStore =
new Raven.Client.Embedded.EmbeddableDocumentStore() {
UseEmbeddedHttpServer = false
IndexCreation.CreateIndexes(GetType().Assembly, documentStore);
container.Register(c => c.Resolve<IDocumentStore>().OpenSession())

Updated by Daniel Nauck almost 4 years ago


yes RavenDb wants to open a port for its internal HTTP WebInterface .. that needs admin rights. Its not needed for the license manager at all.

  • Status changed from New to Assigned
  • Assignee set to Daniel Nauck

Also available in: Atom PDF