title: ASP.Net Core Web API, deployed under IIS is returning 404
body: <p>I have a new Web API developed in ASP.NET Core. This Web API is supposed to be deployed in IIS and will have to work over SSL, so I have the [HttpsRequired] attribute on all my controllers. I struggle to make it work while deployed, so for now I relaxed the requirements and commented out those attributes. Doing so, I was able to create two bindings in IIS, one for HTTPS and one for HTTP. Given that my Web API is created in ASP.NET Core, I followed the deployment steps Rick Strahl has in his excellent <a href="https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications-with-IIS" rel="nofollow">blog post</a>. I have selected "No Managed Code" for the .NET CLR version. The IIS machine is a 64-bit Windows Server 2012 R2 environment - not sure whether this matters or not. The .NET Core Windows Server Hosting bundle has been installed on the server and I can see the AspNetCoreModule listed in the Modules grid.</p>
  
  <p>If i try to access the Web Api (I created a very simple GET method that returns some information regarding the assembly) with Fiddler, I get a 404 error. For now, i run Fiddler on the same machine, so I tried all combinations (localhost, IP address and full machine name in the domain).</p>
  
  <p>No errors are logged in the EventViewer. Does anyone have any suggestion on how to troubleshoot this issue?</p>
  
  <p>TIA,
  Eddie  </p>
  
  <p>EDIT1: Here is my controller:</p>
  
  <pre><code>[Route("api/info")]
  //[RequireHttps]
  public class InfoController : Controller
  {
    private ITncRepository _repository;
    public static ApplicationAssemblyDetails ApplicationAssemblyDetails { get; set; }
  
    public InfoController(ITncRepository repository)
    {
       _repository = repository;
       ApplicationAssemblyDetails = ApplicationAssemblyDetails.Current;
    }
  
    [HttpGet("")]
    public JsonResult Get()
    {
       return Json(new WebApiInfoModel()
                       {
                          CurrentTime  = DateTime.Now,
                          CurrentUtcTime = DateTime.UtcNow,
                          AssemblyName = ApplicationAssemblyDetails.ApplicationAssembly.FullName,
                          VersionNumber = ApplicationAssemblyDetails.VersionNumber,
                          BinFolder = ApplicationAssemblyDetails.BinFolder,
                          BuildMode = ApplicationAssemblyDetails.BuildMode,
                          TradeMark = @" © 2016-2017 * SomeCompany (www.somecompany.com)"
       });
    }
  }
  </code></pre>
  
  <p>The ApplicationAssemblyDetails is a nuget package that gives some info about the current assembly. WebApiInfoModel is my model class for the Web API Information I want to pass back as a test to the client.</p>
  
  <p>The web.config file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;handlers&gt;
        &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /&gt;
      &lt;/handlers&gt;
      &lt;aspNetCore processPath=".\My_ASP_NET_Core_Web_API.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="true" /&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Finally, to answer your last question, Ignas, I use a Publishing Profile that uses the File system as a method, targets the .NET Framework 4.5.2, using the release configuration. Given that my project is a Web API and not an MVC 6 Web Application, the publishing package creates a stand-alone application. Since the clients need to call my Web API using SSL, I think that it has to be hosted in IIS, so running the standalone application would not work. Of course, for testing purposes, I could try to run it. That's why I commented out the [HttpsRequired] attribute. I will try that and report back, but for now I hope I gave you all the information you required.</p>