title: IIS ASP.NET Core application not starting
body: <p>I have created an ASP.NET Core web api that has been tested on many PC's but when deploying to client's IIS server, the application does not start or produce any error, as checked in Application Event logs.
  Running the executable directly, the application works and you can browse to the ASP.NET Core website.
  I navigated to the web.config file to find the dll to run:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;location path="." inheritInChildApplications="false"&gt;
      &lt;system.webServer&gt;
        &lt;handlers&gt;
          &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /&gt;
        &lt;/handlers&gt;
        &lt;aspNetCore processPath="dotnet" arguments=".\MY_API.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" /&gt;
      &lt;/system.webServer&gt;
    &lt;/location&gt;
  &lt;/configuration&gt;
  &lt;!--ProjectGuid: c1c1b8d5-abcd-479f-9e7a-abcdefghijkl--&gt;
  </code></pre>
  
  <p>running <code>dotnet MY_API.dll</code> produces the following:</p>
  
  <p><a href="https://i.stack.imgur.com/I48wp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I48wp.png" alt="Unable to start Kestrel[0] Attempt made to access socket in way forbidden by access permissions"></a></p>
  
  <p>The port is not bound to any other application, as when i run the executable, it binds to the port successfully and i can navigate to localhost:port and the api swagger interface is displayed.
  The <code>dotnet</code> command successfully runs the application on my development PC.</p>
  
  <p>I can confirm that IIS is running the same modules that i am running on my dev PC and the same .net runtime hosting bundle is installed on the server as is installed on my dev PC.
  I feel that this is just a permissions issue, that the security policy perhaps is preventing me from binding ports using the <code>dotnet</code> command, which i have read that is what IIS uses to launch the application in the background.</p>
  
  <p>My knowledge on service accounts and ApplicationPoolIdentities are very limited. What is the permissions that would prevent the application to bind the port using the <code>dotnet</code> command, where running the executable allows me to bind to the port? How do i change these permissions?</p>