title: Publish .NETCore 2 API and host on IIS
body: <p>I've created a .net Core 2 API and published it to the server. </p>
  
  <p>The file structure looks very odd compared to a normal .Net MVC structure </p>
  
  <p>Normal Structure I am familiar with </p>
  
  <p><a href="https://i.stack.imgur.com/Jy0Oh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jy0Oh.png" alt="enter image description here"></a></p>
  
  <p>And this is the structure of the deployed .NET CORE 2 API</p>
  
  <p><a href="https://i.stack.imgur.com/zJ9J9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zJ9J9.png" alt="enter image description here"></a></p>
  
  <p>Now if I just try and convert that folder to an application like a normal ASP.NET app, it doesn't work. </p>
  
  <p>I've installed <a href="https://docs.microsoft.com/en-us/aspnet/core/publishing/iis" rel="nofollow noreferrer">the .NET Core Windows Server Hosting bundle</a> on the server, but I'm still missing something.</p>
  
  <p>Where do you add this code to enable IISIntegration ?</p>
  
  <pre><code>var host = new WebHostBuilder()
      .UseKestrel()
      .UseContentRoot(Directory.GetCurrentDirectory())
      .UseIISIntegration()
      .UseStartup&lt;Startup&gt;()
      .Build();
  </code></pre>