Reputation: 2389
I have a Web Api application.when i run this application on localhost
then it is working good..for eg:- [http://localhost:5034/].
It gives defult page which i set in root.config(index page)after that
i am trying to access the one of the action of this serviceby this
URL [http://localhost:5034/api/Products]
and this Action give the response in form of json successfully in localhost..
But when i deploy this service on IIS 7.5 I deployed this service then after when i trying to access the application by this URL[http://localhost/WebAPIApplication/]
(This URL is deployed Application URL) then it gives a directory List insted of defult Page which i set in root.config
2/21/2013 3:17 PM <dir> bin
2/21/2013 3:17 PM <dir> Content
2/19/2013 3:36 PM 32038 favicon.ico
2/19/2013 3:36 PM 112 Global.asax
2/21/2013 3:17 PM <dir> Images
2/19/2013 3:36 PM 1431 packages.config
2/21/2013 3:17 PM <dir> Scripts
2/21/2013 3:17 PM <dir> Views
2/21/2013 3:18 PM 5566 Web.config
Why i am not getting the Defult page?
and also when i trying to access Action of this service by this
URL[http://localhost/WebAPIApplication/api/products]
then it give error :
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
How can i solve both the Problem?
Thanks in Advance..
Upvotes: 2
Views: 4508
Reputation: 174309
Make sure that you configured your Web API application in IIS to use a .NET 4 ASP.NET Application Pool.
Upvotes: 2