FluffyBeing
FluffyBeing

Reputation: 468

ASP.NET Web API index.html does not load; Server Error in '/' Application, The resource cannot be found

I'm following this tutorial.

When I build the solution the index.html page would not show up and I get this error: Server Error in '/' Application. I'm not sure how to enable detailed error reporting.

This is my Web.config page:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <appSettings>
    <add key="webpages:Version" value="2.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>

  <system.web>

    <httpRuntime targetFramework="4.5" />

    <compilation debug="true" targetFramework="4.5" />
    <customErrors mode="Off"/>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>

  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />

  <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers></system.webServer>
</configuration>

IIS Express shows it as http://localhost:11527/

Upvotes: 1

Views: 2937

Answers (1)

Kiran
Kiran

Reputation: 57949

Are you sure you are accessing it like http://localhost:11527/index.html. Note that this was created with an Empty project template and so there is no MVC and so you cannot expect a default view showing up and so you would need to explicitly mention index.html in your url.

Upvotes: 2

Related Questions