title: Asp .net core httpsys exception - Access Denied
body: <p>I'am having trouble to find the right permission to give to a domain service account to be able to run my api (as a Windows Service).</p>
  
  <p>I'm propbably missing something, so any help would appreciated :)</p>
  
  <p>I registered the proper url with netsh.
  I can run the service with my user account (which is admin like).
  I am able to run the service if I listen to <a href="http://localhost:28000/public/v1/" rel="nofollow noreferrer">http://localhost:28000/public/v1/</a> but not with port localhost:80 or anything else than localhost.
  I added my service account in the Administrators group, same error.</p>
  
  <p>I'm working on virtual machine running Windows Server 2016 Standard. A domain is configured and I am the only computer on the domain.</p>
  
  <p>Thanks</p>
  
  <p>Here is the full stack trace:</p>
  
  <blockquote>
    <p>info:
    Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
          User profile is available. Using 'C:\Users_esbapi\AppData\Local\ASP.NET\DataProtection-Keys' as key
    repository and Windows DPAPI to encrypt keys at rest. info:
    Microsoft.AspNetCore.Server.HttpSys.HttpSysListener[0]
          Start 
    info: Microsoft.AspNetCore.Server.HttpSys.HttpSysListener[0]
          Listening on prefix: <a href="http://localhost:80/public/v1/" rel="nofollow noreferrer">http://localhost:80/public/v1/</a> fail: Microsoft.AspNetCore.Server.HttpSys.HttpSysListener[0]
          Start 
    Microsoft.AspNetCore.Server.HttpSys.HttpSysException (0x80004005): Access is denied    at
    Microsoft.AspNetCore.Server.HttpSys.UrlGroup.RegisterPrefix(String
    uriPrefix, Int32 contextId)    at
    Microsoft.AspNetCore.Server.HttpSys.UrlPrefixCollection.RegisterAllPrefixes(UrlGroup
    urlGroup)    at
    Microsoft.AspNetCore.Server.HttpSys.HttpSysListener.Start()</p>
    
    <p>Unhandled Exception:
    <strong>Microsoft.AspNetCore.Server.HttpSys.HttpSysException: Access is denied</strong>
    at Microsoft.AspNetCore.Server.HttpSys.UrlGroup.RegisterPrefix(String
    uriPrefix, Int32 contextId)    at
    Microsoft.AspNetCore.Server.HttpSys.UrlPrefixCollection.RegisterAllPrefixes(UrlGroup
    urlGroup)    at
    Microsoft.AspNetCore.Server.HttpSys.HttpSysListener.Start()    at
    Microsoft.AspNetCore.Server.HttpSys.MessagePump.StartAsync[TContext](IHttpApplication`1
    application, CancellationToken cancellationToken)    at
    Microsoft.AspNetCore.Hosting.Internal.WebHost.d__26.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task)    at
    Microsoft.AspNetCore.Hosting.WebHostExtensions.d__5.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task)    at
    Microsoft.AspNetCore.Hosting.WebHostExtensions.d__4.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task)    at
    Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)<br>
    at EventsServiceHost.StartConsole() in EventsServiceHost.cs:line 22<br>
    at Program.Main(String[] args) in Program.cs:line 38</p>
  </blockquote>