title: How to deploy a .NET Core project to Windows Server 2012 R2
body: <p>I deployed my .NET Core project to Windows Server 2012 R2 64-bit and this happened:</p>
  <p><a href="https://i.stack.imgur.com/szxaf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/szxaf.png" alt="enter image description here" /></a>
  HTTP Error 502.5 - Process Failure according to Microsoft guide, they said that it is because of platform conflicts with RID.</p>
  <p>(<a href="https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x#common-errors" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x#common-errors</a>)</p>
  <p>I had already come through every step in that guide but can not fix it. So anyone knows how to fix this? I would be appreciated if you could. Thank you.</p>
  <p>Note: I had already give publish folder full permission and also installed ASPNetCoreModule v2.0, net core sdk 2.0. My IIS version is 8.5.</p>
  <p>Here is my .csproj:</p>
  <pre><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk.Web&quot;&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp2.0&lt;/TargetFramework&gt;
      &lt;RootNamespace&gt;_MyAppAPI&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;_MyAppAPI&lt;/AssemblyName&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;PropertyGroup Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|AnyCPU'&quot;&gt;
      &lt;DocumentationFile&gt;&lt;/DocumentationFile&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Content Remove=&quot;wwwroot\swagger\authen\basic-auth.js&quot; /&gt;
      &lt;Content Remove=&quot;wwwroot\swagger\ui\custome.css&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Folder Include=&quot;Middleware\&quot; /&gt;
      &lt;Folder Include=&quot;Logs\&quot; /&gt;
      &lt;Folder Include=&quot;Models\appapi\&quot; /&gt;
      &lt;Folder Include=&quot;wwwroot\lib\&quot; /&gt;
      &lt;Folder Include=&quot;wwwroot\logs\&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;Microsoft.AspNetCore.All&quot; Version=&quot;2.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.SqlServer&quot; Version=&quot;2.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Tools&quot; Version=&quot;2.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.VisualStudio.Web.CodeGeneration.Design&quot; Version=&quot;2.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Serilog.Extensions.Logging.File&quot; Version=&quot;1.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Swashbuckle.AspNetCore&quot; Version=&quot;1.0.0&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;DotNetCliToolReference Include=&quot;Microsoft.VisualStudio.Web.CodeGeneration.Tools&quot; Version=&quot;2.0.0&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;EmbeddedResource Include=&quot;wwwroot\swagger\authen\basic-auth.js&quot; /&gt;
      &lt;EmbeddedResource Include=&quot;wwwroot\swagger\ui\custome.css&quot; /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  <p>And web.config after build:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;handlers&gt;
        &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; modules=&quot;AspNetCoreModule&quot; resourceType=&quot;Unspecified&quot; /&gt;
      &lt;/handlers&gt;
      &lt;aspNetCore processPath=&quot;dotnet&quot; arguments=&quot;.\_MyAppAPI.dll&quot; stdoutLogEnabled=&quot;false&quot; stdoutLogFile=&quot;.\logs\stdout&quot; /&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  &lt;!--ProjectGuid: 2510f4bb-368b-4ab2-96e1-5d06b14d677e--&gt;
  </code></pre>
  <p>I ran into this: <a href="https://stackoverflow.com/questions/41590493/iis-fails-to-run-asp-net-core-site-http-error-502-5">IIS fails to run ASP.NET Core site - HTTP Error 502.5</a></p>
  <p>Seem to be exactly my problem. But I cannot find an .exe file anywhere</p>