I am having this weird issue with VS 2015 Update 3 while running Web API project via IIS Express. Here are the steps I followed
1> Start Visual Studio 2015 (with Update 3)
2> Select new Asp.NET 4.6.2 web project
3> Select Empty Project - > and check Web.API check box
4> Once the solution is ready then create new Controller using Web API2 Controller with read/write actions
and name the controller DocumentController
5>The routeTemplate is set as routeTemplate: "api/{controller}/{id}"
at project startup.
6> Press F5 to run the application
7> Visual studio host the API in IIS express as http://localhost:53394
so I type http://localhost:53394/api/document
and I see some json result in the browser as expected.
8> Now i change API project's project URL from http://localhost:53394
to http://localhost:53394/api/document
hoping I don't have to type whole url everytime. When I change the URL I get prompt
I select yes. However that doesn't work. In-fact now my URL becomes http://localhost:53394/api/document/api/document
9> So I change the project URL back to what it was http://localhost:53394
. This time it didn't prompt me.
10>Now when I try to access the api usinghttp://localhost:53394/api/document
I get error
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory
but if I access api using URL http://localhost:53394/api/document/api/document
then I get result back.
I have tried restarting visual studio, clearing browsers history with no luck Not sure why & where VS caching URL.