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
To resolve this problem, use one of the following methods: Make sure that the requested resource is at the location that the URL points to. Review the URL that you open in the Web browser. Make sure that no custom filters or modules restrict access to the file that you want to browse.
A simple solution is to check for the HTTP status code 404 in the response. If found, you can redirect the control to a page that exists. The following code snippet illustrates how you can write the necessary code in the Configure method of the Startup class to redirect to the home page if a 404 error has occurred.
Resolution. To resolve this problem, verify that the file requested in the browser's URL exists on the IIS computer and that it is in the correct location. Use the IIS Microsoft Management Console (MMC) snap-in to determine where the file requested must exist in the IIS computer's file system.
In an ASP.NET application, configure Web API by calling GlobalConfiguration. Configure in the Application_Start method. The Configure method takes a delegate with a single parameter of type HttpConfiguration. Perform all of your configuration inside the delegate.
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>
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With