简体   繁体   中英

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

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>

使用OWIN运行WebApi时也会显示此错误消息,并且您忘记在启动类中包含以下行:

app.UseWebApi(config);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM