Ryan
Ryan

Reputation: 143

WebAPI Error 404.0 - Not Found

We are having issues deploying our WebAPI service onto our production server. When attempting to access the Controller we receive "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

We created a new project from the standard WebAPI Template and it has the same problem, so it is definitely not our code that is causing the issue. We also have another server with the same hosting company and when deployed to that everything works fine. All IIS features are identical between servers.

At one stage we had the Application Pool set to .Net Framework 2.0 and the Website did not complain about that so it isn't even trying to spin up the service. We also have an odata service on the same web application and it is all functioning fine. So it seems to be something to do with MVC routing and WebAPI.

We copied across every dll that we could think of to the server but nothing fixed the situation.

Does anyone have any ideas on what could be different between the 2 servers that would cause the error above?

Thanks in advance

Upvotes: 8

Views: 28656

Answers (3)

Nerdroid
Nerdroid

Reputation: 13966

try this article

HTTP Error 404.0 0 Not Found in MVC

or this

Running ASP.NET MVC Under IIS 6.0 and IIS 7.0 Classic Mode : Solution to Routing Problem

or try adding the following to Web.config:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/> 
</system.webServer>

Upvotes: 6

mkaj
mkaj

Reputation: 3489

This error message is also displayed when running your WebApi using OWIN and you forget to include the following line in your startup class:

app.UseWebApi(config);

Upvotes: 1

Related Questions