2

In short words, everything works on local machine but doesn't when deployed to server "A".

I'm sure someting is missing in server "A", but I don't know what it is, and I don't have access there to make changes or proper testing.

So I'm here to aks for help and ideas of what the problem may be so that I can advise the person in charge of server "A", or whatever changes I need to make on my project to make it work there.

That being said, lets talk about my project...

I'm using Web Api, and a route is defined in the global.asax as such:

RouteTable.Routes.MapHttpRoute(
            name: "DefaultApi",
            routeTemplate: "api/{controller}/{id}",
           defaults: new { id = System.Web.Http.RouteParameter.Optional });

I'm calling the controllers using Jquery ajax and Kendo UI, as such:

(this is a fake example just to prove the point)

read: {
        url: function () {
               return "../api/Member/123";
        }
}

Again, everything works great on local server, but when I deploy it, I get for every web api call:

404 - File or directory not found.

Nothing else.

Things to consider:

  • I'm compiling the project with .NET 4.0 framework.
  • The website on server "A" is set up to use .NET 4.0 classic (could this be a problem?)
  • I don't think MVC 4 is installed in server "A". Does Web Api requires MVC?
  • Server "A" is running IIS 7

I added the following to the web.config file, but still get the 404 error:

<modules runAllManagedModulesForAllRequests="true"/>

Let me know if you need any other information.

Thanks for your help!!

tereško
  • 58,060
  • 25
  • 98
  • 150
Naner
  • 1,292
  • 6
  • 25
  • 43
  • Download MVC4 to use WebAPI http://www.microsoft.com/en-us/download/details.aspx?id=30683 – Ryan Gunn Mar 25 '13 at 19:30
  • Thanks Icidis, I'm going to see if I can get MVC installed there. I was hoping the problem was something else. What about the .NET version being used, whats the difference between classic and integrated? – Naner Mar 25 '13 at 19:36
  • I always use integrated mode. But heres a quick explination. http://stackoverflow.com/questions/716049/what-is-the-difference-between-classic-and-integrated-pipeline-mode-in-iis7 – Ryan Gunn Mar 25 '13 at 19:41
  • Installing MVC4 solved it. Thanks. If you create an answer I'll set it as the right one. ;) – Naner Mar 25 '13 at 20:39

1 Answers1

0

Download MVC4 to use ASP.NET WebAPI. http://www.microsoft.com/en-us/download/details.aspx?id=30683

Ryan Gunn
  • 1,161
  • 7
  • 18