6
Well, I have a Web Api, which is configured as follows:
WebApiConfig.Cs
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
and my GlobalAsax
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
}
}
However, for some reason you are not finding the files. And generates the following problem:
HTTP Error 403.14 - Forbidden The web server is configured not to list the contents of this directory.
Most likely causes:
A standard document is not configured for the requested URL, and the search in the >directory is not enabled on the server.
Why does that happen?
How can I solve this problem?
What version of
IIS
are you using? Take a look at this help from MS– Marcelo de Andrade
@Marcelodeandrade IIS 10.0 Express. I had already tried this, with no positive results
– Renan Carlos
The route you are accessing is not serving your api, it is simply trying to access a directory and the document view/list is not enabled. What is the url you are trying to access?
– Leandro Angelo