Unable to get WebAPI application running on Windows 2008 server

I am new to web API applications. I created my first application with only one simple controller with only one Get () method that returns a List. It works fine on my PC. Even after publishing the solution and accessing it through my IIS 7.5, the results are fine: I get access to

http://localhost/Application/api/Controller 

and I get the answer that I expect.

So, I went on to the next step: deploying it to another server so that other people in my office could access it. The server we use starts the Windows 2008 server. What I did was just copy the Publish folder generated by the publishing team in Visual Studio 2012 and paste it into the inetpub \ wwwroot folder on the server computer. Then I turned to IIS 7.5, which ran on the server, and created a new application using the .NET 4.0 application pool, using the Publish folder as my physical path (exactly the same steps that I did on my PC to publish it to my IIS).

Problem: when I try to access the application on the server machine (which starts the Windows 2008 server), I get error 404. It looks like it is trying to find the physical path Application \ api \ Controller that can resolve it logically, like my machine.

I tried all the various solutions that I found on the Internet:

  • I have included all the verbs in ExtensionlessUrl-Integrated-4.0 under the mapping configuration for the application in IIS.
  • I added WebApiConfig.Register (GlobalConfiguration.Configuration); in my global asax.

What I noticed is that the .NET Framework 4.5 is installed on my machine, and the server machine has only the 4.0 framework (client and advanced). But I get the same error even after compiling an application aimed at framework 4.0.

The only MVC.dll that I have in my bin directory is System.Web.Mvc.dll ... do I need any other DLL?

Thanks in advance.

+4
source share
1 answer

Try the following:

 <system.webServer> ..... <modules runAllManagedModulesForAllRequests="true" /> ..... </system.webServer> 
+5
source

All Articles